XFsm.Machine (XFsm v0.5.0)

View Source

Documentation for XFsm.Machine.

Summary

Types

t()

@type t() :: %XFsm.Machine{
  actions: %{required(atom()) => (... -> any())},
  actor: nil | pid(),
  always: [XFsm.Always.t()],
  context: XFsm.context(),
  events: [XFsm.Event.t()],
  guards: %{required(atom()) => (... -> any())},
  initial: atom(),
  state: nil | atom(),
  states: [XFsm.State.t()]
}

Functions

init(module, opts \\ [])

@spec init(
  module(),
  keyword()
) :: t()

transition(machine, event)

@spec transition(t(), XFsm.event()) :: t()