Workers to be added to this pool immediately.
List of the idle workers in this pool.
List of queued tasks in this pool.
A list of all the workers in this pool.
Returns whether or not there are tasks running in this pool.
Returns the total number of workers held by this pool.
Returns a class instance that can be used as a singleton.
Adds the specified worker to this pool and, optionally, runs an init task.
The worker to add
Init task to be executed immediately on the worker
Adds an array of workers to this pool and, optionally, runs an init task on them.
A list of workers to add
Init task to be executed immediately on each of the workers added
Cancels all pending tasks in this pool.
WARNING: Tasks that have already been sent to workers are NOT cancelled.
Cancels pending tasks of the specified type.
WARNING: Tasks that have already been sent to workers are NOT cancelled.
The task id (name) or a task instance to be cancelled.
Executes the specified task in the worker provided and listens for a response. If a success message is received from the worker, the task promise is resolved with the results, the promise is rejected with an explanation otherwise.
Worker which will run the task
Task to execute
Checks if there are pending tasks in the queue, if so, the next task is executed in the worker provided. If no tasks are pending, the worker is flagged as idle.
Worker that will execute a task or be marked as idle.
Immediately kills all the workers in this pool.
WARNING: Pending and running tasks will not resolve their promises when this method is called.
Makes a WorkerTask to be executed by any of the workers in this pool.
The task id (name) to execute
Any arguments that need to be passed to the task as described in the TaskExecutor
List of objects that will be transferred to the worker. NOTE: Transferred objects are invalidated after the task is sent and cannot be used anymore.
Removes a single worker from the pool, there are no guarantees as to which worker will be removed.
Schedules a task to be executed in a worker as soon as one is available. There are no guarantees as of which worker will perform the task.
Task to schedule
Schedules an array of tasks to be executed in workers as soon as they become available. There are no guarantees as of which workers will perform the tasks.
List of tasks to execute
Wraps a worker in a WorkerWrapper instance, if the worker is already wrapped, this function simply returns the already wrapped worker.
Worker to wrap
Wraps multiple workers in WorkerWrapper instances, worker that are already wrapped are returned as-is.
List of workers to wrap
Generated using TypeDoc
Class to manage multiple workers, send tasks to them and receive results.