DurableTask.Symphony 1.2.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package DurableTask.Symphony --version 1.2.1
NuGet\Install-Package DurableTask.Symphony -Version 1.2.1
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="DurableTask.Symphony" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DurableTask.Symphony --version 1.2.1
#r "nuget: DurableTask.Symphony, 1.2.1"
#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.
// Install DurableTask.Symphony as a Cake Addin
#addin nuget:?package=DurableTask.Symphony&version=1.2.1

// Install DurableTask.Symphony as a Cake Tool
#tool nuget:?package=DurableTask.Symphony&version=1.2.1

DurableTask.Symphony

This repo contains the library code to interact with Durable Task Framework (DTFx).

About

It contains wrappers, services, extensions, and other helper methods to configure and use TaskHubClient and TaskHubWorker as injectable services, as well as reading state information from the configured OrchestrationServiceBase, which configured to use SQL server as a task hub.

Usage

Database configuration

Run Create-DurableTables.sql in the config/ directory of this repo. This will create the required tables and stored procedures for the Orchestration Hub.

Task Worker configuration

In the IHost ConfigureServices() configuration methods, use the extension methods to configure the Orchestration Hub and the Task Worker.

IHost.CreateDefaultBuilder(args)
	 .ConfigureServices((hostBuilderContext, services) =>
	 {
		services.AddOrchestrationHub(options =>
				{
					// Adds the backing SQL connection for storage and persistence
					options.ConnectionString = "DurableContextSQLConnectionString"
					options.MaxActiveOrchestrations = 10;
				})
				.AddTaskWorker(options => 
				{
					// Adds the Task Worker hosted services
					options.ErrorPropagationMode = ErrorPropagationMode.UseFailureDetails);
				})
				.WithRegisteredOrchestrations(new[]
				{
					// Adds Orchestrations as transient services and registers them with the Task Worker
					typeof(SampleOrchestration),
					typeof(AnotherOrchestration)
				})
				.WithRegisteredActivities(new[]
				{
					// Adds Activities and transient services and registers them with the Task Worker
					typeof(SampleActivity),
					typeof(AnotherActivity)
				});
	 })
	 .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 on the task worker (server) to function.

Task Client configuration

In the IHost ConfigureServices() configuration methods, use the extension methods to configure the connection to the Orchestration Hub.

IHost.CreateDefaultBuilder(args)
	 .ConfigureServices((hostBuilderContext, services) =>
	 {
		services.AddOrchestrationHub(options =>
				{
					// Adds the backing SQL connection for storage and persistence
					options.ConnectionString = "DurableContextSQLConnectionString"
				})
				.AddTaskClient();
	 })
	 .Build();

To start an Orchestration, inject an instance of the ITaskClient service and use the StartOrchestration or ScheduleOrchestration methods.

Download

NuGet version (DurableTask.Symphony)

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.3 96 4/1/2024
1.3.2 96 3/21/2024
1.3.1 65 3/14/2024
1.3.0 97 3/8/2024
1.2.2 94 2/15/2024
1.2.1 219 11/28/2023
1.1.2 117 10/26/2023
1.1.1 161 8/28/2023
1.1.0 151 8/3/2023

- Update version to match referenced version of Microsoft.DurableTask.SqlServer for compatibility purposes
- Added usage notes and SQL creation script
- Update packages