Type of data sent to the worker. This can only be structured-cloneable data.
Type of execution response. This can only be structured-cloneable data.
Constructs a new poolifier dynamic thread pool.
Minimum number of threads which are always active.
Maximum number of threads that can be created by this pool.
Path to an implementation of a ThreadWorker file, which can be relative or absolute.
Options for this dynamic thread pool.
ProtecteddestroyingWhether the pool is destroying or not.
OptionalemitterProtected ReadonlyfilePath to the worker file.
Protected Optional ReadonlymaximumMaximum number of workers that this pool manages.
Protected ReadonlyminimumMinimum number of workers that this pool manages.
Protected ReadonlyoptsOptions for the pool.
ProtectedpromiseThe task execution response promise map:
key: The message id of each submitted task.value: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.
ProtectedstartedWhether the pool is started or not.
ProtectedstartingWhether the pool is starting or not.
Protected OptionalworkerWorker choice strategies context referencing worker choice algorithms implementation.
ReadonlyworkerProtectedbackWhether the pool is back pressured or not.
The pool back pressure boolean status.
ProtectedbusyWhether the pool is busy or not.
The pool busyness boolean status.
ProtectedtypeThe pool type.
If it is 'dynamic', it provides the max property.
ProtectedworkerThe worker type.
ProtectedafterHook executed after the worker task execution. Can be overridden.
The worker node key.
The received message.
ProtectedafterMethod hooked up after a worker node has been newly created. Can be overridden.
The newly created worker node key.
ProtectedbeforeProtectedcheckEmits dynamic worker creation events.
ProtectedcheckEmits dynamic worker destruction events.
ProtectedcreateCreates a new, completely set up dynamic worker node.
New, completely set up dynamic worker node key.
ProtectedcreateCreates a new, completely set up worker node.
New, completely set up worker node key.
ProtectedderegisterDeregisters a listener callback on the worker given its worker node key.
The worker node key.
The message listener callback.
ProtecteddestroyTerminates the worker node given its worker node key.
The worker node key.
ProtectedflagProtectedflushProtectedgetGets the worker information given its worker node key.
The worker node key.
The worker information.
ProtectedinternalWhether the worker nodes are back pressured or not.
Worker nodes back pressure boolean status.
ProtectedinternalWhether worker nodes are executing concurrently their tasks quota or not.
Worker nodes busyness boolean status.
ProtectedisReturns whether the worker is the main worker or not.
true if the worker is the main worker, false otherwise.
ProtectedregisterRegisters once a listener callback on the worker given its worker node key.
The worker node key.
The message listener callback.
ProtectedregisterRegisters a listener callback on the worker given its worker node key.
The worker node key.
The message listener callback.
ProtectedsendSends the startup message to worker given its worker node key.
The worker node key.
ProtectedsendSends a message to worker given its worker node key.
The worker node key.
The message.
OptionaltransferList: readonly Transferable[]The optional array of transferable objects.
ProtectedsetupSetup hook to execute code before worker nodes are created in the abstract constructor. Can be overridden.
OptionalworkerChoiceStrategyOptions: WorkerChoiceStrategyOptionsProtectedshallConditions for dynamic worker creation.
Whether to create a dynamic worker or not.
Protected ReadonlyworkerThis method is the message listener registered on each worker.
The message received from the worker.
A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.
This thread pool creates new threads when the others are busy, up to the maximum number of threads. When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's
emitter.Author
Alessandro Pio Ardizio
Since
0.0.1