From cce0774cffcee591407eee4d4530daa37aab3eca Mon Sep 17 00:00:00 2001 From: Rogger Valverde Date: Mon, 13 May 2024 18:44:39 -0600 Subject: [PATCH] docs(pro): add local group concurrency section (#2551) --- docs/gitbook/SUMMARY.md | 1 + .../groups/local-group-concurrency.md | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 docs/gitbook/bullmq-pro/groups/local-group-concurrency.md diff --git a/docs/gitbook/SUMMARY.md b/docs/gitbook/SUMMARY.md index 6188945bc8..f2c51a95ca 100644 --- a/docs/gitbook/SUMMARY.md +++ b/docs/gitbook/SUMMARY.md @@ -83,6 +83,7 @@ * [Groups](bullmq-pro/groups/README.md) * [Rate limiting](bullmq-pro/groups/rate-limiting.md) * [Concurrency](bullmq-pro/groups/concurrency.md) + * [Local group concurrency](bullmq-pro/groups/local-group-concurrency.md) * [Max group size](bullmq-pro/groups/max-group-size.md) * [Pausing groups](bullmq-pro/groups/pausing-groups.md) * [Prioritized intra-groups](bullmq-pro/groups/prioritized.md) diff --git a/docs/gitbook/bullmq-pro/groups/local-group-concurrency.md b/docs/gitbook/bullmq-pro/groups/local-group-concurrency.md new file mode 100644 index 0000000000..4482b04572 --- /dev/null +++ b/docs/gitbook/bullmq-pro/groups/local-group-concurrency.md @@ -0,0 +1,21 @@ +# Local group concurrency + +It is also possible to set a specific concurrency value to a given group. This is useful if you require that different groups should run with different concurrency factors. + +Please keep in mind that when specifying a group's concurrency factor, you are storing this value in Redis, so it is your responsibility to remove it if you are not using it anymore. + +You can use the `setGroupConcurrency` method like this: + +```typescript +import { QueuePro } from '@taskforcesh/bullmq-pro'; + +const queue = new QueuePro('myQueue', { connection }); +const groupId = 'my group'; +await queue.setGroupConcurrency(groupId, 4); +``` + +And you can use the `getGroupConcurrency` method like this: + +```typescript +const concurrency = await queue.getGroupConcurrency(groupId); +```