runInState

suspend fun <T> runInState(targetState: SessionState, block: suspend CoroutineScope.() -> T): T

Guarantees that an operation runs within the active session state.

Parameters

targetState

optional transition state during execution

block

suspendable operation to execute