Scoop API

scoop:scoop.concurrent:0.1.0

BlockingTaskPool

class BlockingTaskPool

source · line 4
public
public class BlockingTaskPool public constructor(threads: Int) : Closeable

A fixed managed thread pool for ordinary blocking work, including GC-managed closures.

function invokeOnTermination

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

Registers a disposable ordinary notification, called unlocked or immediately if terminated.

function join

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

Joins the stopped workers. Shutdown must already have been requested.

function requestShutdown

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

Stops admission and lets all accepted work finish. Does not cancel running work.

function awaitTermination

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

Waits for workers to leave their work loops; cancellation only ends this wait.

function close

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

Requests shutdown and joins from a thread outside this pool.