CompletionQueue
A FIFO queue that runs each task to completion before the next task is started.
new CompletionQueue(name [, callbacks])
Creates a completion queue instance. CompletionQueue inherits from Queue. It only differs
with its flush method that prevents repeat .flush calls
from running tasks until the first .flush call is complete.
Parameters
- name
{String}:The name of the queue used for logging.
- callbacks
{Object}:Optional. An object containing callbacks
onFirstTaskand/oronComplete.onFirstTask- is called when the first task is added to an empty queueonComplete- is called when the queue is empty.
Returns
{Object}:
An instance of CompletionQueue.