X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FDynamicThreadPool.html;h=c9b126cc88102e3da49055f46db881b6943aaf74;hb=310ec53bbcd0289d0d0f7d254f7d8fc38db05ad9;hp=fa708b4b42d12141a962733b982f30918d2e3620;hpb=7e2a464b15953320c79646e2ff88d953db4e5b96;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index fa708b4b..c9b126cc 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,11 +1,13 @@
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, an event is emitted. If you want to listen to this event, use the pool's emitter
.
of data sent to the worker. This can only be serializable data.
- -of response of execution. This can only be serializable data.
-0.0.1
@@ -30,9 +28,13 @@ When the maximum number of threads is reached, an event is emitted. If you wantType of response of execution. This can only be serializable data.
+Constructs a new poolifier dynamic thread pool.
Path to an implementation of a ThreadWorker
file, which can be relative or absolute.
Optional
opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}Options for this dynamic thread pool.
Optional
Readonly
emitterReadonly
filePath to the worker-file.
+Inherited from FixedThreadPool.filePath
Readonly
maxProtected
Readonly
maxInherited from FixedThreadPool.max
-Protected
nextId of the next message.
+Maximum number of threads that can be created by this pool.
Inherited from FixedThreadPool.nextMessageId
Readonly
numberNumber of workers that this pool should manage.
+Inherited from FixedThreadPool.numberOfWorkers
Readonly
optsOptions for the pool.
+Inherited from FixedThreadPool.opts
Protected
promiseThe promise map.
+Protected
promiseThe promise response map.
key
: This is the message Id of each submitted task.value
: An object that contains the worker, the resolve function and the reject function.key
: The message id of each submitted task.value
: An object that contains the worker, the promise resolve and reject callbacks.When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.
+When we receive a message from the worker we get a map entry with the promise resolve/reject bound to the message.
Inherited from FixedThreadPool.promiseMap
+Inherited from FixedThreadPool.promiseResponseMap
Protected
workerInherited from FixedThreadPool.workerChoiceStrategyContext
Readonly
workers{@inheritDoc}
+Inherited from FixedThreadPool.workers
Readonly
workersInherited from FixedThreadPool.workersTasksUsage
-{@inheritDoc}
+Overrides FixedThreadPool.busy
{@inheritDoc}
+Inherited from FixedThreadPool.numberOfRunningTasks
{@inheritDoc}
+Overrides FixedThreadPool.type
Protected
afterProtected
afterHook executed after the worker task promise resolution. Can be overridden.
@@ -265,24 +249,24 @@ Can be overridden.The received message.
+The worker.
The Promise response.
+The received message.
Inherited from FixedThreadPool.afterPromiseWorkerResponseHook
+Inherited from FixedThreadPool.afterPromiseResponseHook
Protected
after{@inheritDoc}
+Inherited from FixedThreadPool.afterWorkerSetup
Protected
beforeProtected
beforeHook executed before the worker task promise resolution. Can be overridden.
@@ -304,27 +288,27 @@ Can be overridden.The worker.
+The worker key.
Inherited from FixedThreadPool.beforePromiseWorkerResponseHook
+Inherited from FixedThreadPool.beforePromiseResponseHook
Protected
chooseChooses a worker for the next task.
The default implementation uses a round robin algorithm to distribute the load.
-Worker.
+[worker key, worker].
Inherited from FixedThreadPool.chooseWorker
Protected
createInherited from FixedThreadPool.createAndSetupWorker
Protected
create{@inheritDoc}
+Inherited from FixedThreadPool.createWorker
{@inheritDoc}
+Inherited from FixedThreadPool.destroy
{@inheritDoc}
+Inherited from FixedThreadPool.destroyWorker
{@inheritDoc}
+Inherited from FixedThreadPool.execute
Inherited from FixedThreadPool.findFreeWorker
-Inherited from FixedThreadPool.getWorkerAverageTasksRunTime
-Inherited from FixedThreadPool.getWorkerIndex
-Inherited from FixedThreadPool.getWorkerRunningTasks
-Initializes tasks usage statistics.
+{@inheritDoc}
The worker.
-Inherited from FixedThreadPool.initWorkerTasksUsage
+Inherited from FixedThreadPool.findFreeWorkerKey
Protected
internalInherited from FixedThreadPool.internalExecute
-Protected
internalInherited from FixedThreadPool.internalGetBusyStatus
Protected
is{@inheritDoc}
+Inherited from FixedThreadPool.isMain
{@inheritDoc}
+Inherited from FixedThreadPool.registerWorkerMessageListener
Protected
removeWorker that will be removed.
+The worker that will be removed.
Inherited from FixedThreadPool.removeWorker
Protected
send{@inheritDoc}
+Inherited from FixedThreadPool.sendToWorker
{@inheritDoc}
+Inherited from FixedThreadPool.setWorkerChoiceStrategy
Protected
setupInherited from FixedThreadPool.setupHook
Protected
workerInherited from FixedThreadPool.workerListener
Type of data sent to the worker. This can only be serializable data.
+