A thread pool interface.

Variables

read onlyisShutdown:Bool

Indicates if shutdown method of this pool has been called.

read onlythreadsCount:Int

Amount of alive threads in this pool.

Methods

run(task:() ‑> Void):Void

Submit a task to run in a thread.

Throws an exception if the pool is shut down.

shutdown():Void

Initiates a shutdown. All previousely submitted tasks will be executed, but no new tasks will be accepted.

Multiple calls to this method have no effect.