StackableScope

open class StackableScope(shared: Boolean)

A stackable scope to support structured constructs. The push method is used to push a StackableScope to the current thread's scope stack. The tryPop and popForcefully methods are used to pop the StackableScope from the current thread's scope stack.

Inheritors

Constructors

Link copied to clipboard
constructor(shared: Boolean)
constructor()

Creates a stackable scope owned by the current thread.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Returns the scope that encloses this scope.

Returns the scope of the given type that encloses this scope.

Link copied to clipboard
open fun owner(): Job?

Returns the scope owner or null if not owned.

Link copied to clipboard
suspend fun popForcefully(): Boolean

Pops this scope from the current thread's scope stack.

Link copied to clipboard

Returns the scope that directly encloses this scope, null if none.

Link copied to clipboard
open suspend fun push(): StackableScope

Pushes this scope onto the current thread's scope stack.

Link copied to clipboard
suspend fun tryPop(): Boolean

Pops this scope from the current thread's scope stack if the scope is at the top of stack.