4 releases (2 breaking)

new 0.10.0 Feb 6, 2025
0.9.0 Jan 4, 2025
0.8.1 Dec 5, 2024
0.8.0 Nov 27, 2024

#2270 in Algorithms

Download history 131/week @ 2024-11-23 158/week @ 2024-11-30 42/week @ 2024-12-07 9/week @ 2024-12-14 173/week @ 2025-01-04 10/week @ 2025-01-11 108/week @ 2025-02-01

126 downloads per month
Used in edfsm-kv-store

Apache-2.0

44KB
735 lines

Event driven FSM Machine

edfsm-machine effectively implements the Actor Model for Rust, where its messages are the inputs, events and outputs.

edfsm-machine provides a convenient way to drive an edfsm-based finite state machine with inputs (commands and events), and a means to capture its resulting events and "outputs". Outputs are the consequence of invoking edfsm's side-effect handling, and usually means capturing an output buffer of effects.

Upon initialising the machine and wiring up inputs, event logs and outputs, a future is produced that can be spawned by executors such as those provided by tokio.

Taking this further, a machine's inputs can be conveniently sourced from a streambed-logged log of events that have been persisted, and logged back there. These adaptations provides an event-sourcing-based Actor Model.

Dependencies

~2.8–10MB
~93K SLoC