Readonly
emitterReadonly
offReadonly
onReadonly
optionsthe current number of child processes currently servicing tasks
the current running Tasks (mostly for testing)
For integration tests:
true if all previously-enqueued tasks have settled
the mean number of tasks completed by child processes
the number of pending tasks
the current pending Tasks (mostly for testing)
the current number of spawned child processes. Some (or all) may be idle.
the total number of child processes created by this instance
Shut down any currently-running child processes. New child processes will be started automatically to handle new tasks.
Shut down this instance, and all child processes.
should an attempt be made to finish in-flight tasks, or should we force-kill child PIDs.
Verify that each BatchProcess PID is actually alive.
the spawned PIDs that are still in the process table.
Reset the maximum number of active child processes to maxProcs
. Note that
this is handled gracefully: child processes are only reduced as tasks are
completed.
For diagnostics. Contents may change.
Run maintenance on currently spawned child processes. This method is normally invoked automatically as tasks are enqueued and processed.
Only public for tests.
BatchCluster instances manage 0 or more homogeneous child processes, and provide the main interface for enqueuing
Task
s viaenqueueTask
.Given the large number of configuration options, the constructor receives a single options hash. The most important of these are the
ChildProcessFactory
, which specifies the factory that creates ChildProcess instances, andBatchProcessOptions
, which specifies how child tasks can be verified and shut down.