Continues to poll the queue for the first-in unit of work to be done and then executes it until there is no more work left in the queue.
Continues to poll the queue for the first-in unit of work to be done and then executes it until there is no more work left in the queue.
NOTE: If the unit of work throws an exception it will be propagated to the caller.
Polls the queue for the first-in unit of work to be done and then executes it.
Polls the queue for the first-in unit of work to be done and then executes it.
NOTE: If the unit of work throws an exception it will be propagated to the caller.
true if work was done, false if the queue is empty
WorkQueue provides a backing concurrent queue to store a backlog of work to be done and can be invoked arbitrarily based on the needs of the implementation.
Enqueueing work can be done via the companion object: WorkQueue.enqueue(workQueue, function).
NOTE: Implementations must make calls to doWork() and/or doAllWork() or the queue will never be processed.