PriorityQueue
A queue that you can enqueue into (with priority) and flush.
new PriorityQueue(name [, callbacks])
Creates a priority queue instance.
A PriorityQueue works like a CompletionQueue. Except:
- PriorityQueues run tasks in order of their
meta.priority. - PriorityQueues only allows one instance of a given
fnto be enqueued at one time.
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 PriorityQueue.