X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=1ae188dd53cb2f194e586a0c82087db7f9ed1dc8;hb=f2fdaa86fd9e6f3a5dc0b3146c065e3a7bfb44e0;hp=6d7f5569f75f9027cae94136eccc9f1dcb023c6a;hpb=d3c8a1a8022726094160d1413f1f289c5d84d715;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 6d7f5569..1ae188dd 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -102,6 +102,13 @@ export abstract class AbstractPool< } } + protected removeWorker (worker: Worker): void { + // Clean worker from data structure + const workerIndex = this.workers.indexOf(worker) + this.workers.splice(workerIndex, 1) + this.tasks.delete(worker) + } + /** * Execute the task specified into the constructor with the data parameter. *