Extensions and helpers to interact with DTFx
$ dotnet add package DurableTask.LavaThis repo contains the library code to interact with Durable Task Framework (DTFx) in-memory using Netherite as the orchestration hub.
This library contains wrappers, services, extensions, and other helper methods to configure and use TaskHubClient and TaskHubWorker as injectable services.
This configuration uses an in-memory orchestration hub; history, events, and other data are NOT saved when the application stops.
In the IHost ConfigureServices() configuration methods, use the extension methods to configure the Orchestration Hub and the Task services.
IHost.CreateDefaultBuilder(args)
.ConfigureServices((hostBuilderContext, services) =>
{
// Adds:
// - memory orchestration hub
// - task worker
// - task client
// - scans for Orchestrations and Activities and registers them
services.AddInMemoryOrchestrations();
})
.Build();
Orchestrations must be classes that implement TaskOrchestration<TOutput, TInput>. Activities must be classes that implement TaskActivity<TInput, TOutput> or AsyncTaskActivity<TInput, TOutput>.
Orchestrations and Activities must be registered to function.
To start an Orchestration, inject an instance of the ITaskClient service and use the StartOrchestration or ScheduleOrchestration methods.