Module: StateMachines::AsyncMode

Defined in:
lib/state_machines/async_mode.rb,
lib/state_machines/async_mode/async_events.rb,
lib/state_machines/async_mode/async_machine.rb,
lib/state_machines/async_mode/thread_safe_state.rb,
lib/state_machines/async_mode/async_event_extensions.rb,
lib/state_machines/async_mode/async_transition_collection.rb

Overview

AsyncMode provides asynchronous state machine capabilities using the async gem This module enables concurrent, thread-safe state operations for high-performance applications

Examples:

Basic usage

class AutonomousDrone < StarfleetShip
  state_machine :teleporter_status, async: true do
    event :power_up do
      transition offline: :charging
    end
  end
end

drone = AutonomousDrone.new
Async do
  result = drone.fire_event_async(:power_up)  # => true
  task = drone.power_up_async!               # => Async::Task
end

Defined Under Namespace

Modules: AsyncEventExtensions, AsyncEvents, AsyncMachine, ThreadSafeState Classes: AsyncTransitionCollection, AsyncTransitionError