ThreadPool.submit

SubmitResult submit(Task task) @trusted

Submit a task for execution by the thread pool.

The task will be queued and executed by an available worker thread. If the queue is full, this method blocks until space is available (unless the pool is shutting down).

Parameters

taskThe delegate to execute.

Returns

SubmitResult.SUCCESS if the task was queued,

SubmitResult.REJECTED if the pool is not accepting tasks.