Package-level declarations
Types
Allows to mutate some properties, which is necessary during setup, before machine is started Those properties are not passed through StateMachine's constructor to make DSL syntax more nice and readable.
Functions
Factory method for creating StateMachine. Suspendable code will be called via Kotlin Standard library (without Kotlin Coroutines library support).
Destroys machine structure clearing all listeners, states etc. This a terminal operation, means that machine cannot be used anymore.
Blocking analog of destroy
Blocking analog of StateMachine.processEvent which can be called from usual (not suspendable) code.
Shortcut for StateMachine.stopBlocking and StateMachine.start sequence calls
Suspendable stopBlocking analog. Should be preferred especially if called from machine notifications.
Forces state machine to stop Warning: calling this function from notification callback may cause deadlock if you are using single threaded coroutineContext, so stop should be preferred.
Returns StateMachine.IgnoredEventHandler implementation that throws exception. This might be useful if you want to control that all events are handled (not skipped) by your StateMachine.
Returns StateMachine.PendingEventHandler implementation that throws exception. This is an old default behaviour.
Rolls back transition (usually it is navigating machine to previous state). Previous states are stored in a stack, so this method mey be called multiple times if needed. This function has same effect as alternative syntax processEvent(UndoEvent), but throws if undo feature is not enabled.
Blocking analog of undo