{"repo":"qmuntal/stateless","free":true,"listed":false,"github":"https://github.com/qmuntal/stateless","clone":"git clone https://github.com/qmuntal/stateless.git","description":"Go library for creating finite state machines","language":"Go","stars":1379,"topics":["go","golang","state-machine","dot-graph","state-diagram","fsm","statechart"],"license":"BSD-2-Clause","category":"dev-tools","readme_excerpt":"Stateless Create state machines and lightweight state machine-based workflows directly in Go code: This project, as well as the example above, is almost a direct, yet idiomatic, port of dotnet-state-machine/stateless, which is written in C#. The state machine implemented in this library is based on the theory of UML statechart. The concepts behind it are about organizing the way a device, computer program, or other (often technical) process works such that an entity or each of its sub-entities is always in exactly one of a number of possible states and where there are well-defined conditional transitions between these states. Features Most standard state machine constructs are supported: Support for states and triggers of any comparable type (int, strings, boolean, structs, etc.) Hierarchical states Entry/exit events 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 Thread-safe Export to DOT graph Hierarchical States In the example below, the OnHold state is a substate of the Connected state. This means that an OnHold call is still connected. In addition to the StateMachine.State property, which will report the precise current state, an IsInState(State) method is provided. IsInState(State) will take substates into account, so that if the example above was in the OnHold state, IsInState(State.","default_branch":null,"files":null,"tree":[],"storefront":"/r/qmuntal","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/qmuntal/stateless/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}