1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-22 18:52:44 +00:00

update kdocs of BehaviourContextWithFSM

This commit is contained in:
2021-10-15 17:55:13 +06:00
parent 4ac01d0104
commit 21c0e375f5
2 changed files with 17 additions and 1 deletions

View File

@@ -20,6 +20,13 @@ private suspend fun <I : State> BehaviourContextWithFSM.launchStateHandling(
}
}
/**
* 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 DefaultBehaviourContextWithFSM
* @see buildBehaviourWithFSM
*/
interface BehaviourContextWithFSM : BehaviourContext, StatesMachine {
suspend fun start() = start(this)
@@ -41,6 +48,10 @@ interface BehaviourContextWithFSM : BehaviourContext, StatesMachine {
}
}
/**
* Default realization of [BehaviourContextWithFSM]. It uses [behaviourContext] as a base for this object as
* [BehaviourContext], but managing substates contexts updates for avoiding of updates lost between states
*/
class DefaultBehaviourContextWithFSM(
private val behaviourContext: BehaviourContext,
private val statesManager: StatesManager,