Ananke.StateMachine
0.9.2
See the version list below for details.
dotnet add package Ananke.StateMachine --version 0.9.2
NuGet\Install-Package Ananke.StateMachine -Version 0.9.2
<PackageReference Include="Ananke.StateMachine" Version="0.9.2" />
<PackageVersion Include="Ananke.StateMachine" Version="0.9.2" />
<PackageReference Include="Ananke.StateMachine" />
paket add Ananke.StateMachine --version 0.9.2
#r "nuget: Ananke.StateMachine, 0.9.2"
#:package Ananke.StateMachine@0.9.2
#addin nuget:?package=Ananke.StateMachine&version=0.9.2
#tool nuget:?package=Ananke.StateMachine&version=0.9.2
Ananke.StateMachine
Distributed state machine engine for .NET — RedLock coordination, composable middleware pipeline, guard conditions, and fault/reset circuit breaking.
Install
dotnet add package Ananke.StateMachine
Quick start
Define states, transitions, and wire them up:
public class OrderMachine(IDistributedLock locker)
: AbstractStateMachine<OrderCtx, OrderState, OrderTransition, OrderEvent>(
OrderState.Pending, locker)
{
protected override Action<ITransitionBuilder<OrderState, OrderTransition>> Transitions => b => b
.From(OrderState.Pending)
.On(OrderTransition.Reserve).GoTo(OrderState.Reserved)
.On(OrderTransition.Cancel).GoTo(OrderState.Cancelled)
.From(OrderState.Reserved)
.On(OrderTransition.Confirm).GoTo(OrderState.Confirmed)
.On(OrderTransition.Cancel).GoTo(OrderState.Cancelled);
}
DI registration
using Ananke.StateMachine.Extensions;
services.AddStateMachine(o => o
.AllowImplicitSelfTransitions(false)
.ConfigureLockRetry(maxRetries: 5));
// Register your concrete state machine
services.AddStateMachine<OrderMachine, OrderCtx, OrderState, OrderTransition, OrderEvent>();
AddStateMachine registers an in-memory IDistributedLock by default. Add Ananke.Redis to replace it with Redis-backed locking — call order doesn't matter.
Features
- Distributed locking — safe coordination across instances via
IDistributedLock - Composable middleware — intercept every transition for logging, metrics, validation
- Guard conditions — block transitions based on runtime state
- Fault / Reset — circuit breaker per context (
FaultAsyncrefuses one context's transitions, on every node, untilResetAsync) - Lifecycle hooks —
OnEnter/OnExitper state - OpenTelemetry tracing — built-in
ActivitySourcefor transition spans
Related packages
| Package | What it adds |
|---|---|
Ananke.Redis |
Redis-backed IDistributedLock and IKeyValueDataAdapter |
Ananke.MQTT |
MQTT-backed pub/sub channels for distributed messaging |
Ananke |
Meta-package — includes StateMachine + Orchestration + Bridge |
Documentation
Full docs, demos, and architecture: github.com/sevensamurai/Ananke
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- Ananke.Abstractions (= 0.9.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.13)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Ananke.StateMachine:
| Package | Downloads |
|---|---|
|
Ananke
Ananke — distributed state machine + workflow orchestration for .NET. Install this meta-package to get StateMachine, Orchestration, and the Bridge integration layer in one step. |
|
|
Ananke.AspNetCore
ASP.NET Core integration helpers for Ananke — SSE streaming, ChatSessionEvent-to-SSE bridging, and state-machine endpoint utilities. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.9.3 | 0 | 11/24/2026 |
| 0.9.2 | 55 | 11/20/2026 |
| 0.9.1 | 132 | 11/3/2026 |
| 0.9.0 | 160 | 9/22/2026 |
| 0.8.9 | 182 | 8/18/2026 |
| 0.8.8 | 165 | 8/3/2026 |
| 0.8.7 | 149 | 7/19/2026 |
| 0.8.6 | 165 | 6/22/2026 |
| 0.8.5 | 165 | 6/15/2026 |
| 0.8.4 | 163 | 5/29/2026 |
| 0.8.3 | 160 | 5/17/2026 |
| 0.8.2 | 154 | 5/15/2026 |
| 0.8.1 | 155 | 5/9/2026 |
| 0.8.0 | 156 | 5/9/2026 |
| 0.7.2 | 161 | 4/12/2026 |
| 0.7.1 | 158 | 4/11/2026 |
| 0.7.0 | 167 | 4/11/2026 |
| 0.6.0 | 160 | 4/10/2026 |
| 0.5.0 | 159 | 4/5/2026 |
| 0.4.0 | 154 | 4/3/2026 |