AccountExecutionHold

class AccountExecutionHold(val scope: UserSessionScope, endHold: () -> Unit, releaseUnlessAllowed: suspend () -> Unit)

Keeps scope's account open in the background for work that has execution time of its own, such as a call or a background task. Release it before that time ends.

Constructors

Link copied to clipboard
internal constructor(scope: UserSessionScope, endHold: () -> Unit, releaseUnlessAllowed: suspend () -> Unit)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
suspend fun release()

Ends the hold once, then releases the account unless the app is in the foreground or another hold keeps it. Concurrent calls wait for that release; a failed release can be retried without ending another hold.