X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Futils.ts;h=df9c256e95390d0731b730ae6726678d5bcbdfb7;hb=b1a6445cf82a7c06495f1ec774fb7b04fb7f9336;hp=b33726a69f3f72113061d8fb918983ef75cbfa59;hpb=5bdd0e9accf9420d408cd6befd0b9b2b705c2e75;p=poolifier.git diff --git a/src/pools/utils.ts b/src/pools/utils.ts index b33726a6..df9c256e 100644 --- a/src/pools/utils.ts +++ b/src/pools/utils.ts @@ -43,7 +43,7 @@ export const getDefaultTasksQueueOptions = ( size: Math.pow(poolMaxSize, 2), concurrency: 1, taskStealing: true, - tasksStealingOnBackPressure: true, + tasksStealingOnBackPressure: false, tasksFinishedTimeout: 2000 } } @@ -187,6 +187,21 @@ export const checkWorkerNodeArguments = ( 'Cannot construct a worker node with a tasks queue back pressure size option that is not a positive integer' ) } + if (opts.tasksQueueBucketSize == null) { + throw new TypeError( + 'Cannot construct a worker node without a tasks queue bucket size option' + ) + } + if (!Number.isSafeInteger(opts.tasksQueueBucketSize)) { + throw new TypeError( + 'Cannot construct a worker node with a tasks queue bucket size option that is not an integer' + ) + } + if (opts.tasksQueueBucketSize <= 0) { + throw new RangeError( + 'Cannot construct a worker node with a tasks queue bucket size option that is not a positive integer' + ) + } } /**