asyncStateMachine

inline fun <S, E, C : Any, A : Any, R : Any> asyncStateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, argumentClass: KClass<out A>, returnClass: KClass<out R>, handler: AsyncDslStateMachineHandler<S, E, C, A, R>.() -> Unit): AsyncDslStateMachineHandler<S, E, C, A, R>

These function are used to create statemachines where the actions are suspend functions.


inline fun <S, E, C : Any, A : Any> asyncStateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, argumentClass: KClass<out A>, handler: AsyncDslStateMachineHandler<S, E, C, A, Any>.() -> Unit): AsyncDslStateMachineHandler<S, E, C, A, Any>

Defines the start of a state machine DSL declaration with Any as the return type

Parameters

validStates

A set of the possible states supported by the top-level state map

validEvents

The class of the possible events*

contextClass

The class of the context

argumentClass

The class of the argument to events/actions

handler

The state machine handler

Samples

io.jumpco.open.kfsm.TurnstileFSM.definition
inline fun <S, E, C : Any> asyncStateMachine(validStates: Set<S>, validEvents: Set<E>, contextClass: KClass<out C>, handler: AsyncDslStateMachineHandler<S, E, C, Any, Any>.() -> Unit): AsyncDslStateMachineHandler<S, E, C, Any, Any>

Defines the start of a state machine DSL declaration with Any as the type of arguments and returns types for events/actions

Parameters

validStates

A set of the possible states supported by the top-level state map

validEvents

The class of the possible events

contextClass

The class of the context

Samples

io.jumpco.open.kfsm.TurnstileFSM.definition