Methods
start
- Start the runner and begin execution of tasks
- Returns
false
if the runner is busy or destroyed - The
start
method can be used to unpause the runner
pause
- Pauses the runner instance
- Running tasks are unaffected
- Once all running tasks are done, the runner will be marked as idle
- Returns
false
if the runner is destroyed - The
start
method can be used to unpause the runner
destroy
- Destroys the runner instance
- Running tasks are unaffected
- Once all running tasks are done, the runner will be marked as idle
setConcurrency
- Sets the concurrency of the runner
- Concurrency should be a positive integer, or
-1
- Setting concurrency as
-1
would run all tasks at once - If concurrency is not bound, throws a
RangeError
add
Type:
TaskWithDone
- Add a task to end of the pending list
- Passing
true
as the second argument will add the task to the beginning of the pending list
addFirst
Type:
TaskWithDone
- Add a task to the beginning of the pending list
- Alias for
add
with the second argument astrue
addAt
Type:
TaskWithDone
- Add a task at a particular index to the pending list
- Index should always be bound, otherwise throws a
RangeError
addMultiple
Type:
TasksWithDone
- Add multiple tasks to end of the pending list
- Passing
true
as the second argument will add the tasks to the beginning of the pending list
addMultipleFirst
Type:
TasksWithDone
- Add multiple tasks to the beginning of the pending list
- Alias for
addMultiple
with the second argument astrue
remove
- Remove the task at the end of the pending list
- Passing
true
as the first argument will remove the task at the beginning of the pending list
removeFirst
- Remove the task at the beginning of the pending list
- Alias for
remove
with the first argument astrue
removeAt
- Remove a task at a particular index
- Index should always be bound, otherwise throws a
RangeError
removeRange
- Remove tasks at a particular range from the pending list
- The count is inclusive of the starting index
- Starting index should always be bound, otherwise throws a
RangeError
removeAll
- Remove all tasks from the pending list