BehaviourContextWithFSM

Interface which combine BehaviourContext and StatesMachine. Subcontext of triggers and states contexts must have one common flow of updates and must not lose updates between updates

See also

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val stateInitialAction: <Error class: unknown class><BehaviourContextWithFSM<T>, Unit, T>

Will be called BEFORE handling of State will be started

Functions

Link copied to clipboard
abstract fun <I : T> add(kClass: KClass<I>, strict: Boolean = false, handler: BehaviourWithFSMStateHandler<I, T>)

Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of kClass will pass this requirement

Link copied to clipboard
open fun <I : T> addStrict(kClass: KClass<I>, handler: BehaviourWithFSMStateHandler<I, T>)

Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == kClass and any State with exactly the same type will pass requirements

Link copied to clipboard
abstract fun copy(bot: <Error class: unknown class>, scope: CoroutineScope, broadcastChannelsSize: Int, onBufferOverflow: BufferOverflow, upstreamUpdatesFlow: Flow<<Error class: unknown class>>?, triggersHolder: <Error class: unknown class>, subcontextInitialAction: <Error class: unknown class><<Error class: unknown class>, Unit, <Error class: unknown class>>): BehaviourContextWithFSM<T>
abstract fun copy(bot: <Error class: unknown class> = this.bot, scope: CoroutineScope = this.scope, broadcastChannelsSize: Int = 100, onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND, upstreamUpdatesFlow: Flow<<Error class: unknown class>>? = null, subcontextInitialAction: <Error class: unknown class><<Error class: unknown class>, Unit, <Error class: unknown class>> = {}, triggersHolder: <Error class: unknown class> = this.triggersHolder, stateInitialAction: <Error class: unknown class><BehaviourContextWithFSM<T>, Unit, T> = this.stateInitialAction, onStateHandlingErrorHandler: <Error class: unknown class><T> = defaultStateHandlingErrorHandler()): BehaviourContextWithFSM<T>
Link copied to clipboard

Add NON STRICT handler to list of available in future BehaviourContextWithFSM. Non strict means that for input State will be used KClass.isInstance and any inheritor of I::class will pass this requirement

Link copied to clipboard
open suspend fun start(): <Error class: unknown class>
Link copied to clipboard

Add STRICT handler to list of available in future BehaviourContextWithFSM. Strict means that for input State will be used State::class == I::class and any State with exactly the same type will pass requirements