saga_state_machine 1.0.1 copy "saga_state_machine: ^1.0.1" to clipboard
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 machine
  • Saga - Base class for saga instances with lifecycle tracking
  • EventHandler - Fluent builder API for event handling
    • when<E>() - Create handler for event type
    • where() - Filter events by condition
    • set() - Set saga properties from event
    • then() - Execute custom async actions
    • execute() - Run activities with optional compensation
    • transitionTo() - Static state transitions
    • transitionToState() - Dynamic state resolution
    • finalize() - Mark saga as complete
    • schedule() / unschedule() - Delayed event scheduling
  • Activity - Side effect abstraction with compensation support
    • FunctionActivity - Inline activity from function
    • NoOpActivity - Placeholder activity
  • Scheduler - Timer-based event scheduling
  • SagaRepository - Pluggable persistence interface
    • InMemorySagaRepository - 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
1
likes
160
points
--
downloads

Publisher

unverified uploader

Weekly Downloads

A MassTransit-style state machine framework for Dart. Declarative, event-driven saga pattern with fluent builder API.

Repository (GitHub)
View/report issues

Topics

#state-machine #saga #event-driven #workflow #finite-state-machine

Documentation

API reference

License

MIT (license)

Dependencies

meta

More

Packages that depend on saga_state_machine