runWithSessionLease
abstract suspend fun runWithSessionLease(session: RadioSessionContext, block: suspend (RadioSessionLease) -> Unit): Boolean(source)
Acquires a lifecycle lease for suspend block. Once admitted, teardown closes admission to later work and waits for this block to finish before publishing session completion or starting a replacement transport. block may use RadioSessionLease.isCurrent for transaction-bound checks that must remain valid through commit even after teardown has closed new admission. Implementations must acquire and release the lease through the same admission state used by teardown; comparing only activeSession cannot satisfy the draining contract. Callers must keep the block bounded and must not invoke transport lifecycle methods from inside it.