diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/worker.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/worker.js b/src/lib/worker.js index beba7f9..e53d03f 100644 --- a/src/lib/worker.js +++ b/src/lib/worker.js @@ -73,6 +73,17 @@ class Worker extends EventEmitter { } /** + * @param {string} target + * @param {number} concurrency + */ + setTargetConcurrency(target, concurrency) { + if (!(target in this.targets)) + throw new Error(`target '${target}' not found`) + + this.targets[target].queue.concurrency = concurrency + } + + /** * Stop queues associated with specified targets. * * @param {null|string[]} targets |