RadioSessionHost

The service side of RadioLink.run: app session admission for the SDK sessions of one link.

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
abstract suspend fun closeSession(session: RadioSessionContext)

Closes admission for session and waits for its admitted work.

Link copied to clipboard

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

Link copied to clipboard

Reports that session's handshake snapshot is installed, so the app may show it connected.

Link copied to clipboard

Reports that session's handshake snapshot was not installed, so the app cannot become connected on it.

Link copied to clipboard

Admits a new app session for the link's next SDK session, or null once the link is no longer selected.

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.