Asynkron.DurableFunctions
0.0.2
See the version list below for details.
dotnet add package Asynkron.DurableFunctions --version 0.0.2
NuGet\Install-Package Asynkron.DurableFunctions -Version 0.0.2
<PackageReference Include="Asynkron.DurableFunctions" Version="0.0.2" />
<PackageVersion Include="Asynkron.DurableFunctions" Version="0.0.2" />
<PackageReference Include="Asynkron.DurableFunctions" />
paket add Asynkron.DurableFunctions --version 0.0.2
#r "nuget: Asynkron.DurableFunctions, 0.0.2"
#:package Asynkron.DurableFunctions@0.0.2
#addin nuget:?package=Asynkron.DurableFunctions&version=0.0.2
#tool nuget:?package=Asynkron.DurableFunctions&version=0.0.2
Asynkron.DurableFunctions Library
This library provides base classes and attributes that replicate the functionality of Azure Durable Functions, but with "Asynkron" prefixes instead of "Azure".
Features
Attributes
FunctionNameAttribute
- Specifies the name of a function (equivalent to Azure's[FunctionName]
)OrchestrationTriggerAttribute
- Specifies that a parameter should be treated as an orchestration trigger (equivalent to Azure's[OrchestrationTrigger]
)
Interfaces
IDurableOrchestrationContext
- Defines the interface for a durable orchestration context (equivalent to Azure'sIDurableOrchestrationContext
)
Context Methods
The IDurableOrchestrationContext
provides the following methods:
CallActivityAsync<TResult>(string name, object? input = null)
- Calls an activity function asynchronously with a return valueCallActivityAsync(string name, object? input = null)
- Calls an activity function asynchronously without a return valueCreateTimer(DateTime fireAt)
- Creates a timer that expires at the specified timeWaitForExternalEvent<TResult>(string name)
- Waits for an external event to be raised
Properties
InstanceId
- Gets the instance ID of the orchestrationCurrentUtcDateTime
- Gets the current date and time in UTCIsReplaying
- Gets a value indicating whether the orchestration is replaying
Usage Example
using Asynkron.DurableFunctions;
public class MyOrchestrator
{
[FunctionName("MyOrchestrator")]
public async Task<string> RunOrchestrator([OrchestrationTrigger] IDurableOrchestrationContext context)
{
var result = await context.CallActivityAsync<string>("MyActivity", "input data");
return result;
}
[FunctionName("MyActivity")]
public string MyActivity(string input)
{
return $"Processed: {input}";
}
}
Current Status
This is a stub implementation. The core attributes and interfaces are implemented, but the actual orchestration runtime is not yet implemented. The CallActivityAsync
, CreateTimer
, and WaitForExternalEvent
methods currently throw NotImplementedException
.
Future Development
To complete the implementation, the following would need to be added:
- Orchestration runtime engine
- Activity function discovery and invocation
- State persistence and replay logic
- Timer management
- External event handling
- ASP.NET Core integration
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. |
-
net8.0
- DurableTask.Core (>= 2.0.0.6)
- Microsoft.Extensions.Logging (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.