Stateless 5.16.0-dev-9221217254
See the version list below for details.
dotnet add package Stateless --version 5.16.0-dev-9221217254
NuGet\Install-Package Stateless -Version 5.16.0-dev-9221217254
<PackageReference Include="Stateless" Version="5.16.0-dev-9221217254" />
paket add Stateless --version 5.16.0-dev-9221217254
#r "nuget: Stateless, 5.16.0-dev-9221217254"
// Install Stateless as a Cake Addin
#addin nuget:?package=Stateless&version=5.16.0-dev-9221217254&prerelease
// Install Stateless as a Cake Tool
#tool nuget:?package=Stateless&version=5.16.0-dev-9221217254&prerelease
Stateless
Create state machines and lightweight state machine-based workflows directly in .NET code:
var phoneCall = new StateMachine<State, Trigger>(State.OffHook);
phoneCall.Configure(State.OffHook)
.Permit(Trigger.CallDialled, State.Ringing);
phoneCall.Configure(State.Connected)
.OnEntry(t => StartCallTimer())
.OnExit(t => StopCallTimer())
.InternalTransition(Trigger.MuteMicrophone, t => OnMute())
.InternalTransition(Trigger.UnmuteMicrophone, t => OnUnmute())
.InternalTransition<int>(_setVolumeTrigger, (volume, t) => OnSetVolume(volume))
.Permit(Trigger.LeftMessage, State.OffHook)
.Permit(Trigger.PlacedOnHold, State.OnHold);
// ...
phoneCall.Fire(Trigger.CallDialled);
Assert.AreEqual(State.Ringing, phoneCall.State);
This project, as well as the example above, was inspired by Simple State Machine (Archived).
Features
Most standard state machine constructs are supported:
- Generic support for states and triggers of any .NET type (numbers, strings, enums, etc.)
- Hierarchical states
- Entry/exit actions for states
- Guard clauses to support conditional transitions
- Introspection
Some useful extensions are also provided:
- Ability to store state externally (for example, in a property tracked by an ORM)
- Parameterised triggers
- Reentrant states
- Export to DOT graph
Documentation
For guidance on how to use Stateles, the project README file contains documentation and code examples. The source repository also includes a few example projects.
Contributing
We welcome contributions to this project. Check CONTRIBUTING.md for more info.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (51)
Showing the top 5 NuGet packages that depend on Stateless:
Package | Downloads |
---|---|
LittleForker
A utility to assist with spawing child processes, monitor their lifecycle and co-operative shutdown. |
|
DiegoRangel.DotNet.Framework.CQRS.Domain.Core
A common library for implementing CQRS based Domain layer. |
|
Hyperledger.Aries
.NET Core tools for building agent services |
|
RedoSocial.Platform.ViewModels.Rx
Package Description |
|
RawRabbit.Operations.StateMachine
Integrate RawRabbit with the Stateless StateMachine. |
GitHub repositories (11)
Showing the top 5 popular GitHub repositories that depend on Stateless:
Repository | Stars |
---|---|
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
|
|
github/VisualStudio
GitHub Extension for Visual Studio
|
|
Azure/iotedge
The IoT Edge OSS project
|
|
dotnetGame/MineCase
Minecraft server based on Orleans
|
|
pardahlman/RawRabbit
A modern .NET framework for communication over RabbitMq
|
Version | Downloads | Last updated |
---|---|---|
5.16.0 | 27,653 | 5/24/2024 |
5.16.0-dev-9514287026 | 54 | 6/14/2024 |
5.16.0-dev-9221217254 | 72 | 5/24/2024 |
5.15.0 | 520,855 | 12/29/2023 |
5.15.0-dev-9171714096 | 72 | 5/21/2024 |
5.15.0-dev-9058520056 | 78 | 5/13/2024 |
5.15.0-dev-8822304149 | 75 | 4/24/2024 |
5.15.0-dev-8790594175 | 73 | 4/22/2024 |
5.15.0-dev-8759383160 | 69 | 4/19/2024 |
5.15.0-dev-7356157229 | 378 | 12/29/2023 |
5.14.0 | 220,241 | 11/14/2023 |
5.14.0-dev-7355700004 | 363 | 12/29/2023 |
5.14.0-dev-7309801955 | 345 | 12/23/2023 |
5.14.0-dev-7232734414 | 388 | 12/16/2023 |
5.14.0-dev-7232709282 | 424 | 12/16/2023 |
5.14.0-dev-7164312319 | 427 | 12/11/2023 |
5.14.0-dev-7078872236 | 435 | 12/3/2023 |
5.14.0-dev-7078811950 | 427 | 12/3/2023 |
5.14.0-dev-6860395514 | 427 | 11/14/2023 |
5.14.0-dev-6851669594 | 404 | 11/13/2023 |
5.14.0-dev-6851630770 | 397 | 11/13/2023 |
5.14.0-dev-6823242034 | 848 | 11/10/2023 |
5.14.0-dev-6813247520 | 438 | 11/9/2023 |
5.14.0-dev-6811706736 | 385 | 11/9/2023 |
5.14.0-dev-6801352798 | 414 | 11/8/2023 |
5.13.0 | 1,637,133 | 12/29/2022 |
5.13.0-dev-6799430915 | 414 | 11/8/2023 |
5.13.0-dev-6746401636 | 412 | 11/7/2023 |
5.13.0-dev-5455458583 | 677 | 7/4/2023 |
5.13.0-dev-5455401408 | 586 | 7/4/2023 |
5.13.0-dev-5235510771 | 570 | 6/11/2023 |
5.13.0-dev-5157129238 | 622 | 6/2/2023 |
5.13.0-dev-4941000713 | 628 | 5/10/2023 |
5.13.0-dev-4940972813 | 626 | 5/10/2023 |
5.13.0-dev-4838097297 | 602 | 4/29/2023 |
5.13.0-dev-4838091545 | 620 | 4/29/2023 |
5.13.0-dev-4838052982 | 615 | 4/29/2023 |
5.13.0-dev-4832488606 | 593 | 4/28/2023 |
5.13.0-dev-4716514070 | 622 | 4/17/2023 |
5.13.0-dev-4701624597 | 630 | 4/14/2023 |
5.13.0-dev-4701061956 | 610 | 4/14/2023 |
5.13.0-dev-4027208421 | 625 | 1/27/2023 |
5.13.0-dev-4027203589 | 660 | 1/27/2023 |
5.13.0-dev-4027201259 | 655 | 1/27/2023 |
5.13.0-dev-3800477155 | 630 | 12/29/2022 |
5.12.0 | 589,720 | 10/17/2022 |
5.12.0-dev-3553426836 | 643 | 11/26/2022 |
5.12.0-dev-3498786305 | 642 | 11/18/2022 |
5.12.0-dev-3267018252 | 662 | 10/17/2022 |
5.11.0 | 3,265,772 | 4/28/2021 |
5.11.0-dev-3264102134 | 632 | 10/17/2022 |
5.11.0-dev-3191463566 | 605 | 10/17/2022 |
5.10.1 | 430,457 | 2/17/2021 |
5.10.1-dev-791423646 | 800 | 4/28/2021 |
5.10.1-dev-787896296 | 794 | 4/27/2021 |
5.10.1-dev-787889564 | 799 | 4/27/2021 |
5.10.1-dev-574334224 | 813 | 2/17/2021 |
5.10.0 | 4,149 | 2/14/2021 |
5.10.0-dev-560201439 | 777 | 2/12/2021 |
5.10.0-dev-560186344 | 815 | 2/12/2021 |
5.10.0-dev-542672901 | 935 | 2/6/2021 |
5.10.0-dev-542661127 | 847 | 2/6/2021 |
5.2.0 | 4,813 | 2/15/2021 |
5.2.0-dev-568743626 | 847 | 2/15/2021 |
5.1.9-dev-00610 | 839 | 2/6/2021 |
5.1.9-dev-00600 | 843 | 1/31/2021 |
5.1.8 | 531,651 | 1/13/2021 |
5.1.8-dev-00558 | 831 | 1/16/2021 |
5.1.8-dev-00553 | 867 | 1/13/2021 |
5.1.7 | 23,536 | 1/10/2021 |
5.1.7-dev-00548 | 882 | 1/10/2021 |
5.1.6 | 2,310 | 1/10/2021 |
5.1.6-dev-00547 | 891 | 1/10/2021 |
5.1.6-dev-00544 | 867 | 1/10/2021 |
5.1.5 | 540,568 | 11/17/2020 |
5.1.5-dev-00528 | 859 | 11/17/2020 |
5.1.4 | 84,963 | 11/7/2020 |
5.1.4-dev-00522 | 914 | 11/7/2020 |
5.1.4-dev-00521 | 921 | 11/7/2020 |
5.1.3 | 927,320 | 8/13/2020 |
5.1.3-dev-00520 | 983 | 11/7/2020 |
5.1.3-dev-00513 | 925 | 8/12/2020 |
5.1.2 | 633,587 | 4/27/2020 |
5.1.2-dev-00508 | 874 | 8/12/2020 |
5.1.2-dev-00501 | 922 | 4/27/2020 |
5.1.1 | 160,148 | 4/3/2020 |
5.1.1-dev-00500 | 961 | 4/27/2020 |
5.1.1-dev-00499 | 911 | 4/27/2020 |
5.1.1-dev-00492 | 963 | 4/3/2020 |
5.1.0 | 51,661 | 3/28/2020 |
5.1.0-dev-00489 | 963 | 4/3/2020 |
5.1.0-dev-00486 | 942 | 4/3/2020 |
5.1.0-dev-00485 | 970 | 4/3/2020 |
5.1.0-dev-00481 | 965 | 3/26/2020 |
5.1.0-dev-00480 | 980 | 3/26/2020 |
5.1.0-dev-00479 | 908 | 3/25/2020 |
5.1.0-dev-00478 | 934 | 3/25/2020 |
5.1.0-dev-00477 | 912 | 3/24/2020 |
5.0.0 | 225,014 | 2/29/2020 |
5.0.0-dev-00476 | 936 | 3/24/2020 |
5.0.0-dev-00473 | 945 | 3/13/2020 |
5.0.0-dev-00472 | 924 | 3/13/2020 |
5.0.0-dev-00471 | 954 | 3/13/2020 |
5.0.0-dev-00464 | 973 | 2/27/2020 |
5.0.0-dev-00463 | 1,024 | 2/27/2020 |
4.4.0 | 211,218 | 2/7/2020 |
4.4.0-dev-00453 | 1,013 | 2/6/2020 |
4.4.0-dev-00451 | 969 | 2/6/2020 |
4.4.0-dev-00450 | 969 | 2/6/2020 |
4.4.0-dev-00447 | 966 | 2/6/2020 |
4.4.0-dev-00445 | 926 | 2/6/2020 |
4.4.0-dev-00443 | 1,252 | 2/6/2020 |
4.3.0 | 246,001 | 11/18/2019 |
4.2.1 | 3,126,405 | 6/2/2018 |
4.2.0 | 16,530 | 6/1/2018 |
4.2.0-dev-00366 | 1,415 | 6/2/2018 |
4.2.0-dev-00364 | 1,361 | 6/1/2018 |
4.2.0-dev-00363 | 1,464 | 6/1/2018 |
4.2.0-dev-00360 | 1,434 | 6/1/2018 |
4.2.0-dev-00355 | 1,571 | 5/31/2018 |
4.2.0-dev-00350 | 1,491 | 5/28/2018 |
4.2.0-dev-00349 | 1,527 | 5/28/2018 |
4.1.0 | 38,526 | 5/18/2018 |
4.1.0-dev-00341 | 1,451 | 5/18/2018 |
4.1.0-dev-00340 | 1,395 | 5/18/2018 |
4.1.0-dev-00337 | 1,432 | 5/18/2018 |
4.1.0-dev-00331 | 1,592 | 5/15/2018 |
4.1.0-dev-00326 | 1,393 | 5/14/2018 |
4.1.0-dev-00319 | 3,868 | 5/11/2018 |
4.1.0-dev-00316 | 1,389 | 5/11/2018 |
4.1.0-dev-00311 | 1,554 | 5/7/2018 |
4.1.0-dev-00307 | 1,474 | 5/4/2018 |
4.1.0-dev-00299 | 1,458 | 4/27/2018 |
4.0.1-dev-00294 | 1,684 | 4/24/2018 |
4.0.1-dev-00275 | 12,863 | 3/24/2018 |
4.0.1-dev-00260 | 5,705 | 10/18/2017 |
4.0.1-dev-00258 | 1,609 | 10/16/2017 |
4.0.1-dev-00256 | 1,841 | 10/6/2017 |
4.0.0 | 710,603 | 9/30/2017 |
4.0.0-dev-00247 | 3,292 | 7/27/2017 |
4.0.0-dev-00244 | 2,693 | 6/15/2017 |
4.0.0-dev-00242 | 1,809 | 6/13/2017 |
4.0.0-dev-00236 | 1,495 | 6/1/2017 |
4.0.0-dev-00223 | 1,554 | 5/19/2017 |
4.0.0-dev-00221 | 1,461 | 5/17/2017 |
4.0.0-dev-00220 | 1,400 | 5/17/2017 |
4.0.0-dev-00217 | 2,660 | 5/15/2017 |
4.0.0-dev-00196 | 1,952 | 4/6/2017 |
4.0.0-dev-00194 | 1,431 | 4/6/2017 |
4.0.0-dev-00187 | 1,481 | 4/6/2017 |
4.0.0-dev-00177 | 1,621 | 3/24/2017 |
4.0.0-dev-00175 | 1,442 | 3/24/2017 |
4.0.0-dev-00173 | 1,457 | 3/24/2017 |
3.2.0-dev-00170 | 1,598 | 3/24/2017 |
3.2.0-dev-00168 | 1,484 | 3/20/2017 |
3.2.0-dev-00166 | 1,650 | 2/28/2017 |
3.1.1-dev-00165 | 1,486 | 2/28/2017 |
3.1.1-dev-00162 | 1,437 | 2/28/2017 |
3.1.1-dev-00155 | 1,490 | 2/20/2017 |
3.1.1-dev-00152 | 1,609 | 2/7/2017 |
3.1.1-dev-00151 | 1,576 | 1/22/2017 |
3.1.1-dev-00143 | 1,544 | 1/3/2017 |
3.1.1-dev-00141 | 1,540 | 1/2/2017 |
3.1.0 | 679,272 | 12/15/2016 |
3.0.2-dev-00132 | 1,986 | 12/8/2016 |
3.0.1 | 15,096 | 11/23/2016 |
3.0.1-dev-00123 | 1,481 | 11/22/2016 |
3.0.1-dev-00113 | 1,905 | 11/11/2016 |
3.0.0 | 101,905 | 11/3/2016 |
3.0.0-dev-00109 | 1,553 | 11/2/2016 |
3.0.0-dev-00108 | 1,542 | 11/2/2016 |
3.0.0-dev-00106 | 1,529 | 11/2/2016 |
3.0.0-dev-00105 | 1,677 | 11/1/2016 |
3.0.0-dev-00099 | 1,701 | 10/31/2016 |
3.0.0-dev-00094 | 2,474 | 10/3/2016 |
3.0.0-dev-00093 | 1,419 | 10/3/2016 |
3.0.0-dev-00092 | 1,471 | 10/3/2016 |
2.5.84 | 103,048 | 8/23/2016 |
2.5.80 | 45,016 | 7/25/2016 |
2.5.79 | 76,595 | 7/19/2016 |
2.5.68 | 12,889 | 7/1/2016 |
2.5.66 | 2,099 | 6/30/2016 |
2.5.62 | 22,351 | 3/29/2016 |
2.5.61 | 36,402 | 3/22/2016 |
2.5.59 | 3,683 | 3/7/2016 |
2.5.56 | 18,848 | 2/25/2016 |
2.5.53 | 94,018 | 2/3/2016 |
2.5.40 | 7,334 | 1/25/2016 |
2.5.36 | 21,167 | 12/10/2015 |
2.5.29 | 41,809 | 11/7/2015 |
2.5.28 | 2,090 | 11/7/2015 |
2.5.23 | 4,095 | 10/28/2015 |
2.5.21 | 40,891 | 7/6/2015 |
2.5.18 | 9,128 | 6/9/2015 |
2.5.15 | 12,632 | 4/9/2015 |
2.5.11 | 61,580 | 10/26/2014 |
2.5.10 | 2,284 | 10/23/2014 |
2.5.8 | 5,758 | 10/20/2014 |
2.4.0 | 59,105 | 3/19/2013 |
2.3.1.1 | 42,786 | 1/7/2011 |