can-queues
Version: 
A light weight JavaScript task queue
20 lines (14 loc) • 935 B
Markdown
 {function} can-queues.CompletionQueue CompletionQueue
 can-queues/types
 can-queues.Queue
 can-queues.CompletionQueue.prototype prototype
 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 [can-queues.Queue]. It only differs
with its [can-queues.CompletionQueue.prototype.flush] method that prevents repeat `.flush` calls
from running tasks until the first `.flush` call is complete.
 {String} [name] The name of the queue used for logging.
 {Object} [callbacks] Optional. An object containing callbacks `onFirstTask` and/or `onComplete`.
  - `onFirstTask` - is called when the first task is added to an empty queue
  - `onComplete` - is called when the queue is empty.
 {Object} An instance of `CompletionQueue`.