Adds a task to the queue.
Error - when queue is destroyed
task function
Optional
data: { data related to task, used for filtering tasks in the queue
Adds specified queue event listener.
Error - when queue is destroyed or unknown event name is given
listener
Adds specified queue event listener that will be called only on first occurrence of event after adding.
Error - when queue is destroyed or unknown event name is given
listener
Destroys queue. Destroying removes waiting tasks, ongoing tasks are continued. You may manually cancel them. Destroyed instance won't allow you to do anything with it anymore.
Returns given task waiting position, 0 means the task will be first to run next time a free slot is ready
task to look for
Adds a task to given point of the queue.
Error - when queue is destroyed
task function
task position in the queue (starting from 0). Keep in mind that ongoing tasks are kept in this list, ie: with concurrency of 2 adding task to index 2 will mean this task will be first to run, not third.
Optional
data: { data related to task, used for filtering tasks in the queue
Adds a task to beginning of the queue.
Error - when queue is destroyed
task function
Optional
data: { data related to task, used for filtering tasks in the queue
Removes specified queue event listener.
Error - when queue is destroyed or unknown event name is given
listener
Generated using TypeDoc
Creates an instance of Queue, optionally definint default options.