ThreadContainer

A container of threads.

Inheritors

Functions

Link copied to clipboard

Return the stream of children of this container.

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 name(): String?

Return the name of this container, may be null.

Link copied to clipboard
open fun onExit(thread: Job)

Invoked when a Thread terminates or starting it fails.

Link copied to clipboard
open fun onStart(thread: Job)

Invoked by Thread::start before the given Thread is started.

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

Returns the scope owner or null if not owned.

Link copied to clipboard
open fun parent(): ThreadContainer?

Returns the parent of this container or null if this is the root container.

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
open fun threadCount(): Long

Return a count of the number of threads in this container.

Link copied to clipboard
abstract fun threads(): Sequence<Job>

Returns a stream of the live threads in this container.

Link copied to clipboard
open override fun toString(): String

The scoped values captured when the thread container was created.

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.