Specifies how many tasks to run simultaneously, default value is 5
.
If true, will continue processing tasks after error occurred.
Handler to process each task.
If provided, can avoid adding duplicate tasks with same keys.
Specifies how many times to retry before one task success.
If one task's retry times execeed, it will never retry automatically,
but you can still retry all failed tasks by calling retry()
manually.
Setting this option to values > 0
implies continueOnError
is true
.
Returns current working state.
The start task array which will be passed to handler
in order.
Abort current queue and all running tasks.
After aborted, queue can still be started manually by calling start()
.
Returns true
if queue was successfully aborted.
Push each task to queue, if not found duplicate task with same key.
Only available when key
specified.
Unshift each task to queue, if not found duplicate task with same key.
Only available when key
specified.
End and finish queue, abort all running tasks and clear all tasks and processing records.
Returns true
if queue was cleared successfully.
Remove all not running tasks and keeps not running tasks and processing records.
Emit specified event with event name
and parameters.
The event name.
The parameters that will be passed to event listeners.
Find first task match test function fn
.
Processed tasks will not be found.
Returns the count of failed tasks.
Returns the failed tasks.
Returns the count of processed tasks.
Returns the count of running tasks.
Returns the running tasks.
Returns the tount of total tasks, included processed and unprocessed and failed.
Returns the count of unprocessed tasks, not include failed tasks.
Returns the unprocessed tasks.
Returns true if found same key task.
Only available when key
specified.
Check whether listener
is in the list for listening specified event name
.
The event name.
The event listener to check.
The scope binded to listener. If provided, will additionally check whether the scope match.
Check whether any listener
is listening specified event name
.
The event name.
Removes the listener
that is listening specified event name
.
The event name.
The event listener, only matched listener will be removed.
The scope binded to listener. If provided, remove listener only when scope match.
Registers an event listener
to listen event with specified name
.
The event name.
The event listener.
The scope will be binded to listener.
Registers an event listener
to listen event with specified name
, triggers for only once.
The event name.
The event listener.
The scope will be binded to listener.
Stop processing tasks, running tasks will not be aborted, but will be locked until resume()
.
Returns true
if paused from running state.
Push tasks to queue.
Removes tasks included in tasksToRemove
list.
Processed tasks will not be removed.
Returns the removed tasks.
Removes all the event listeners.
Removes all tasks that match test function fn
.
Processed tasks will not be removed.
Returns the removed tasks.
Resume processing tasks.
Returns true
if resumed from paused state.
Retry all failed tasks immediately, ignore their retried times.
Returns true
if has failed tasks and queued them.
Start processing tasks. Will emit finish
event in next tick if no task to run.
Returns true
if queue started.
Unshift tasks to queue.
Returns a promise which will be resolved after all tasks finished, or be rejected if error happens.
Generated using TypeDoc
Class to queue tasks and transfer them to handler in specified concurrency.
Type of task.
Type of returned values from handler. This can be inferred from
handler
option normally.