This module provides an abstract class for a [[WorkerQueue]] data structure.
The submodules contain different implementations of that class. See core/queue for more information.
How often to update task statuses, i.e. the next batch of tasks will be executed at the specified interval
(by default on the next tick of the process).
How often to update task statuses, i.e. the next batch of tasks will be executed at the specified interval
(by default on the next tick of the process).
core/queue/worker
This module provides an abstract class for a [[WorkerQueue]] data structure. The submodules contain different implementations of that class. See
core/queue
for more information.Implementations
API
Constructor
Providing a task executor
The structure constructor expects a function that will be invoked on each processed task. The function can return a promise (it will be awaited).
Queue options
[concurrency =
1
]The maximum number of concurrent workers.
[refreshInterval]
How often to update task statuses, i.e. the next batch of tasks will be executed at the specified interval (by default on the next tick of the process).
Class properties
concurrency
The maximum number of concurrent workers.
refreshInterval
How often to update task statuses, i.e. the next batch of tasks will be executed at the specified interval (by default on the next tick of the process).
activeWorkers
Number of active workers.