Scoop API

scoop:scoop.concurrent:0.1.0

MultiThreadExecutor

class MultiThreadExecutor

source · line 9
public
public class MultiThreadExecutor internal constructor(
    workerCount: Int,
    private val blockingPool: BlockingTaskPool,
    private val ownsBlockingPool: Boolean,
    drivers: Array<CoroutineWorkerDriver>?
) : CoroutineExecutor, Closeable

Runs coroutine work on fixed managed workers and blocking work on a separate pool.

function invokeOnTermination

source · line 38
public
public fun invokeOnTermination(handler: () -> Unit): Disposable

Registers an ordinary termination notification without creating another coroutine.

function requestShutdown

source · line 74
public
public fun requestShutdown(): Unit

Stops admission of new roots, preserving active tasks and their children.

function join

source · line 92
public
public fun join(): Unit

Waits for termination and joins owned threads after shutdown has been requested.

function awaitTermination

source · line 86
public
public suspend fun awaitTermination(): Unit

Waits for accepted work and owned workers; cancellation only ends this wait.

function close

source · line 106
public
public override fun close(): Unit

Requests shutdown and joins; cannot be called by work that must itself finish.