Machine

interface Machine<S : Any, E : Any>

Functions

send
Link copied to clipboard
abstract suspend fun send(e: E)

Sends event e to the machine, suspending in case event buffer is overflown. See trySend for a non-suspending variant

trySend
Link copied to clipboard
abstract fun trySend(e: E): Boolean

Tries to send an event e to the machine and returns false if calling send instead of trySend would suspend

Properties

initial
Link copied to clipboard
abstract val initial: Pair<suspend () -> S, suspend (S) -> Unit?>
states
Link copied to clipboard
abstract val states: Flow<S>