saga_state_machine 1.0.1
saga_state_machine: ^1.0.1 copied to clipboard
A MassTransit-style state machine framework for Dart. Declarative, event-driven saga pattern with fluent builder API.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 - 2026-01-17 #
Changed #
- Enhanced README with detailed MassTransit comparison table
- Added side-by-side code examples (C# vs Dart)
- Added "Use Cases" section with common scenarios
- Added "Advanced Features" section with custom Activity and Repository examples
- Improved attribution and links to MassTransit documentation
Fixed #
- Updated LICENSE copyright to saga_state_machine contributors
1.0.0 - 2026-01-17 #
Added #
- Initial release of saga_state_machine
SagaStateMachine- MassTransit-style declarative state machineSaga- Base class for saga instances with lifecycle trackingEventHandler- Fluent builder API for event handlingwhen<E>()- Create handler for event typewhere()- Filter events by conditionset()- Set saga properties from eventthen()- Execute custom async actionsexecute()- Run activities with optional compensationtransitionTo()- Static state transitionstransitionToState()- Dynamic state resolutionfinalize()- Mark saga as completeschedule()/unschedule()- Delayed event scheduling
Activity- Side effect abstraction with compensation supportFunctionActivity- Inline activity from functionNoOpActivity- Placeholder activity
Scheduler- Timer-based event schedulingSagaRepository- Pluggable persistence interfaceInMemorySagaRepository- Default in-memory implementation
BehaviorContext- Context passed to actions and activities- Event correlation via
correlate<E>() - State handlers:
initially(),during(),duringAny() - Timeout support for states
- Transition and finalization callbacks
- Comprehensive test suite (52 tests)
- Two complete examples:
- Order processing workflow
- VoIP call state management