X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=1c1782537d2ebdeef0af1b2c619b873f0895d8ff;hb=402f08b7b31c721d9780c795e5e34a8998bc88aa;hp=b7fba0c61ae31aaa5d6a377084a30609ae4b1385;hpb=c0b0686de0f8c5483b20b94fac97d2b8175c0556;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index b7fba0c6..1c178253 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
fileReadonly
maxProtected
Readonly
maxProtected
nextReadonly
numberReadonly
optsProtected
promiseReadonly
tasksProtected
workerReadonly
workersReadonly
workersProtected
afterHook executed after the worker task promise resolution. +Can be overridden.
+The received message.
+The Promise response.
+Protected
afterProtected
beforeHook executed before the worker task promise resolution. +Can be overridden.
+The worker.
+Protected
chooseChoose a worker for the next task.
+Chooses a worker for the next task.
The default implementation uses a round robin algorithm to distribute the load.
Worker.
@@ -280,7 +321,7 @@ When the maximum number of threads is reached, an event is emitted. If you wantProtected
createProtected
createProtected
decreaseDecrease the number of tasks that the given worker has applied.
-Worker whose tasks are decreased.
-Protected
increaseIncrease the number of tasks that the given worker has applied.
-Worker whose tasks are increased.
-Protected
internalProtected
internalProtected
isProtected
removeWorker that will be removed.
+The worker that will be removed.
Protected
sendProtected
setupProtected
worker
Type of data sent to the worker. This can only be serializable data.
+