![]() |
VOOZH | about |
dotnet add package Sisu.DurableTask.AspNetCore --version 0.0.7
NuGet\Install-Package Sisu.DurableTask.AspNetCore -Version 0.0.7
<PackageReference Include="Sisu.DurableTask.AspNetCore" Version="0.0.7" />
<PackageVersion Include="Sisu.DurableTask.AspNetCore" Version="0.0.7" />Directory.Packages.props
<PackageReference Include="Sisu.DurableTask.AspNetCore" />Project file
paket add Sisu.DurableTask.AspNetCore --version 0.0.7
#r "nuget: Sisu.DurableTask.AspNetCore, 0.0.7"
#:package Sisu.DurableTask.AspNetCore@0.0.7
#addin nuget:?package=Sisu.DurableTask.AspNetCore&version=0.0.7Install as a Cake Addin
#tool nuget:?package=Sisu.DurableTask.AspNetCore&version=0.0.7Install as a Cake Tool
This project enables running DurableTask without a sidecar project, allowing the worker to be self-hosted. It provides a seamless way to integrate Durable Task functionality directly into your Asp .Net Core project.
To use this project effectively, you should already understand the concepts of the Microsoft Durable Task Framework and how to work with it. Microsoft provides comprehensive documentation that covers these topics in detail.
Install the 👁 NuGet version (Sisu.DurableTask.AspNetCore)
package.
dotnet add package Sisu.DurableTask.AspNetCore
To respect the DurableTask domain and reserve it for official packages, I added a prefix to the project assembly. In Finnish culture, sisu represents determination, perseverance, and resilience, which felt like a fitting touch!
Then, register the host with your preferred orchestration service
using DurableTask.AspNetCore;
using DurableTask.AzureStorage;
var orchestrationServiceAndClient = new AzureStorageOrchestrationService(new()
{
StorageAccountClientProvider = new StorageAccountClientProvider("...."),
});
builder.Services.AddSelfHostedDurableTaskHub(orchestrationServiceAndClient);
Finally, register the durabletask-dotnet services and add UseSelfHosted to both the worker and client.
using Microsoft.DurableTask;
using Microsoft.DurableTask.Client;
using Microsoft.DurableTask.Worker;
// Add all the generated tasks
builder.Services.AddDurableTaskWorker(builder =>
{
builder
.AddTasks(r => r.AddAllGeneratedTasks());
.UseSelfHosted();
});
builder.Services.AddDurableTaskClient(b => b.UseSelfHosted());
Now you can inject the DurableTaskClient into your classes to schedule or manage durable tasks. For more detailed examples, check out the samples folder.
To use durable entities, Enable entity work item separation by setting UseSeparateQueueForEntityWorkItems = true in your OrchestrationService.
// Configure the orchestration service
var orchestrationServiceAndClient = new AzureStorageOrchestrationService(new()
{
...
UseSeparateQueueForEntityWorkItems = true
});
// Register the worker and tasks
builder.Services.AddDurableTaskWorker(builder =>
{
builder
.AddTasks(r => r.AddAllGeneratedTasks())
.UseSelfHosted();
});
[DurableTask]
public sealed class MyCounterEntity : TaskEntity<int>
{
public void Add(int amount)
{
State += amount;
}
}
For more detailed examples, check out the samples folder.
The durabletask-dotnet project is built on top of
the Durable Task Framework.
It provides an easy way to run durable tasks using Dependency Injection and IHostedService as a background service in your application.
One of its standout features is a type-safe source generator for orchestrators and activities, making it a breeze to work with. However,
"It's specifically designed to connect to a "sidecar" process, such as the Azure Functions .NET Isolated host, a special purpose sidecar container, or potentially even Dapr.",
so it use gRPC to communicate with the sidecar. In this project the gRPC communication
is replaced with a direct call to the DurableTaskHub service that runs in the same process.
durabletask-dotnet for providing the core Durable Task framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.