Default Updatable States Machine
open class DefaultUpdatableStatesMachine<T : State>(statesManager: StatesManager<T>, handlers: List<CheckableHandlerHolder<in T, T>>) : DefaultStatesMachine<T> , UpdatableStatesMachine<T>
Content copied to clipboard
Functions
handle State
Link copied to clipboard
Will call launchStateHandling for state handling
launch State Handling
Link copied to clipboard
open suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
Content copied to clipboard
perform State Update
Link copied to clipboard
open suspend override fun performStateUpdate(previousState: Optional<T>, actualState: T, scope: CoroutineScope)
Content copied to clipboard
start
Link copied to clipboard
Launch handling of states. On statesManager, statesManager will be called lambda with performing of state. If launchStateHandling will returns some State then statesManager will be used, otherwise StatesManager.endChain.
start Chain
Link copied to clipboard
Just calls StatesManager.startChain of statesManager
update Chain
Link copied to clipboard
Update chain with current state equal to currentState with newState. Behaviour of this update preforming in cases when currentState does not exist in StatesManager must be declared inside of realization of StatesManager.update function