WorkQueue.tryPush

QueueStatus tryPush(WorkItem item) @trusted

Try to push a work item without blocking.

Parameters

itemThe work item to push.

Returns

QueueStatus — success, or a QueueError payload:

QueueErrorReason.FULL if the queue is at capacity, QueueErrorReason.CLOSED if the queue has been closed.

QueueStatus tryPush(void delegate() @safe task, string name = null) @trusted

ditto