OrcaFlow.Core
0.3.0
dotnet add package OrcaFlow.Core --version 0.3.0
NuGet\Install-Package OrcaFlow.Core -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OrcaFlow.Core" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OrcaFlow.Core" Version="0.3.0" />
<PackageReference Include="OrcaFlow.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OrcaFlow.Core --version 0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OrcaFlow.Core, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OrcaFlow.Core@0.3.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OrcaFlow.Core&version=0.3.0
#tool nuget:?package=OrcaFlow.Core&version=0.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Orca
A lightweight, generic task orchestration library for .NET.
Define tasks, chain them into pipelines, run them sequentially or in parallel, and add conditions – all with a minimal API.
✨ Features
- Generic context – pass any type as shared state across tasks
- Fluent builder – chain steps with
.AddStep<T>()or.AddStep(instance) - Conditional execution – skip steps dynamically with
Func<TContext, bool> - Parallel execution – group tasks and run them concurrently with
ParallelGroupTask - Lifecycle hooks –
OnStepStarted,OnStepCompleted,OnStepFailed - Error handling strategies –
StopOnErrororSkipFailed - Cancellation support – via
CancellationToken - Dependency Injection support with
IServiceCollection
🚀 Getting Started
1. Install
NuGet\Install-Package OrcaFlow.Core -Version 0.2.0
2. Define a task
Tasks implement the ITask<TContext> interface:
public class AddTask : ITask<Context>
{
public string Name => nameof(AddTask);
public Task ExecuteAsync(Context context, CancellationToken token = default)
{
context.Result = context.Num1 + context.Num2;
return Task.CompletedTask;
}
}
public class MultiplyTask : ITask<Context>
{
public string Name => nameof(MultiplyTask);
public Task ExecuteAsync(Context context, CancellationToken token = default)
{
context.Result = context.Result * 10;
return Task.CompletedTask;
}
}
3. Build an orchestrator
Create a pipeline with sequential and parallel steps:
var builder = new OrchestratorBuilder<Context>()
.AddStep<AddTask>()
.AddStep<MultiplyTask>()
.Configure(options =>
{
options.ErrorStrategy = ErrorHandlingStrategy.StopOnError;
options.OnStepStarted = async (task, ctx) =>
Console.WriteLine($"Starting {task.Name}...");
options.OnStepCompleted = async (task, ctx) =>
Console.WriteLine($"Completed {task.Name}");
options.OnStepFailed = async (task, ex, ctx) =>
Console.WriteLine($"Step {task.Name} failed: {ex.Message}");
// Middleware
options.Use(async (task, ctx, next, token) =>
{
await next();
});
});
var orchestrator = builder.Build();
Or via DependencyInjection
public void ConfigureServices(IServiceCollection services)
{
// Register services + tasks
services.AddSingleton<MyService>();
services.AddTransient<ServiceBackedTask>();
services.AddTransient<OtherTask>();
// Register orchestrator via extension
services.AddOrchestrator<TestContext>(builder =>
{
builder.AddStep<ServiceBackedTask>()
.AddStep<OtherTask>()
.Configure(o =>
{
o.OnStepStarted = async (task, ctx) =>
Console.WriteLine($"Starting {task.Name}...");
});
});
}
4. Run the pipeline
var ctx = new Context
{
Num1 = 1,
Num2 = 2
};
await orchestrator.RunAsync(context);
Console.WriteLine("Result: " + context.Result);
Or inject the Orchestrator
public class MyController
{
private readonly Orchestrator<TestContext> _orchestrator;
public MyController(Orchestrator<TestContext> orchestrator)
{
_orchestrator = orchestrator;
}
public async Task<IActionResult> Run()
{
var ctx = new TestContext();
await _orchestrator.RunAsync(ctx);
return new OkObjectResult(ctx.Log);
}
}
Roadmap
- Retry policies (with backoff)
Project Structure
/Orca → library code
/Orca.Tests → unit tests
/Samples → Example projects
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.