StateDispatcher

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract val startCommand: String
Link copied to clipboard
abstract val stateClass: KClass<T>

Functions

Link copied to clipboard
fun attach(transitionGate: TransitionGate<T>)
Link copied to clipboard
Link copied to clipboard
open fun entry(input: Input): TransitionResult<T>?
Link copied to clipboard
fun handle(current: State, input: Input): TransitionResult<T>?
Link copied to clipboard
fun handleEvent(current: State, event: Event): TransitionResult<T>?
Link copied to clipboard
open fun onEffectResult(state: State, effectResult: EffectResult)
Link copied to clipboard
open fun onEffectResults(state: State, effectResults: List<EffectResult>)
Link copied to clipboard
open fun transition(state: T, event: Event): TransitionResult<T>

Handles an Event — the result of an AsyncEffectHandler re-entering the FSM. Defaults to a no-op transition; override for any state that starts async work. There is no entry equivalent for events — unlike Input, an Event never starts a flow, only routes by the chat's current state (see FindDispatcherStrategy).

abstract fun transition(state: T, input: Input): TransitionResult<T>