commonMain.dev.inmo.micro_utils.fsm.common.StatesManager.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro_utils.fsm.common-jvm Show documentation
Show all versions of micro_utils.fsm.common-jvm Show documentation
It is set of projects with micro tools for avoiding of routines coding
package dev.inmo.micro_utils.fsm.common
import kotlinx.coroutines.flow.Flow
interface StatesManager {
val onChainStateUpdated: Flow>
val onStartChain: Flow
val onEndChain: Flow
/**
* Must set current set using [State.context]
*/
suspend fun update(old: T, new: T)
/**
* Starts chain with [state] as first [State]. May returns false in case of [State.context] of [state] is already
* busy by the other [State]
*/
suspend fun startChain(state: T)
/**
* Ends chain with context from [state]. In case when [State.context] of [state] is absent, [state] should be just
* ignored
*/
suspend fun endChain(state: T)
suspend fun getActiveStates(): List
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy