class BlockingTaskPool
source · line 4public class BlockingTaskPool public constructor(threads: Int) : Closeable
- Supertype
Closeable - Inherited
fun dispose(): Unit· Closeable
A fixed managed thread pool for ordinary blocking work, including GC-managed closures.
function invokeOnTermination
source · line 13public fun invokeOnTermination(handler: () -> Unit): Disposable
Registers a disposable ordinary notification, called unlocked or immediately if terminated.
parameter handler
source · line 13handler: () -> Unit
property isShutdown
source · line 8public val isShutdown: Boolean
get: public read-only
Whether this pool has stopped accepting work.
getter get
source · line 8get(): Boolean
function join
source · line 31public fun join(): Unit
Joins the stopped workers. Shutdown must already have been requested.
function requestShutdown
source · line 21public fun requestShutdown(): Unit
Stops admission and lets all accepted work finish. Does not cancel running work.
property isTerminated
source · line 10public val isTerminated: Boolean
get: public read-only
Whether accepted work has drained and workers have left their execution loops.
getter get
source · line 10get(): Boolean
constructor constructor
source · line 4constructor(threads: Int)
parameter threads
source · line 4threads: Int
function awaitTermination
source · line 26public suspend fun awaitTermination(): Unit
Waits for workers to leave their work loops; cancellation only ends this wait.
function submit
source · line 16public fun submit(work: BlockingWork): Unit
Queues one work item; rejects submissions after shutdown was requested.
parameter work
source · line 16work: BlockingWork
function close
source · line 36public override fun close(): Unit
- Overrides
close
Requests shutdown and joins from a thread outside this pool.