RadioSessionAuthority

Owns admission and revocation for work bound to one radio session.

Inheritors

Properties

Link copied to clipboard
abstract val activeSession: StateFlow<RadioSessionContext?>

The radio session that still owns lifecycle completion, or null once teardown has joined its scope's work. The session collector's inline handlers can still be finishing then; they are joined when the link closes.

Functions

Link copied to clipboard

Whether session still owns admission; false once teardown starts, while activeSession still holds it.

Link copied to clipboard
suspend fun RadioSessionAuthority.runInSession(session: RadioSessionContext, block: suspend () -> Unit): Boolean

Runs block as a child of session's scope and returns true, or false when the session is closed or closes first. Teardown cancels block; the caller's cancellation cancels it too. A failure in block reaches the caller.

Link copied to clipboard
abstract fun sessionScope(session: RadioSessionContext): CoroutineScope?

The scope session's work runs in while it owns admission, else null. Teardown cancels this scope and joins its children before activeSession clears or a replacement session is admitted; a child that needs to finish (a persistence unit) runs its body under NonCancellable.