[GH-ISSUE #1045] [FEATURE REQUEST] Task aggregation config by group #498

Open
opened 2026-03-02 05:21:35 +03:00 by kerem · 0 comments
Owner

Originally created by @rfid-qr on GitHub (Apr 29, 2025).
Original GitHub issue: https://github.com/hibiken/asynq/issues/1045

Originally assigned to: @hibiken, @kamikazechaser on GitHub.

Is your feature request related to a problem? Please describe.
I have a situation where I want to process multiple group tasks, but there are some groups that need to have a different configuration than the others.

For example, set the default global config

  • GroupMaxDelay 10 minutes
  • GroupGracePeriod 2 * time.Minute
  • GroupMaxSize 20

For group A, it's okay to use the config from the default global config.
but for Group B, I need different configs, for example GroupGracePeriod set to 1 minute or GroupMaxSize set to 50

Describe the solution you'd like
Support config by group name, maybe something like this

  asynq.Config{
     Queues: map[string]int{"notifications": 1},
     GroupAggregator:  asynq.GroupAggregatorFunc(aggregate),
     GroupMaxDelay:    10 * time.Minute,
     GroupGracePeriod: 2 * time.Minute,
     GroupMaxSize:     20,
     GroupConfigs : map[string]asynq.GroupConfig{
           GroupMaxDelay:    5 * time.Minute,
           GroupGracePeriod: 1 * time.Minute,
           GroupMaxSize:     30,
    }
 },
Originally created by @rfid-qr on GitHub (Apr 29, 2025). Original GitHub issue: https://github.com/hibiken/asynq/issues/1045 Originally assigned to: @hibiken, @kamikazechaser on GitHub. **Is your feature request related to a problem? Please describe.** I have a situation where I want to process multiple group tasks, but there are some groups that need to have a different configuration than the others. For example, set the default global config - GroupMaxDelay 10 minutes - GroupGracePeriod 2 * time.Minute - GroupMaxSize 20 For group A, it's okay to use the config from the default global config. but for Group B, I need different configs, for example GroupGracePeriod set to 1 minute or GroupMaxSize set to 50 **Describe the solution you'd like** Support config by group name, maybe something like this ``` asynq.Config{ Queues: map[string]int{"notifications": 1}, GroupAggregator: asynq.GroupAggregatorFunc(aggregate), GroupMaxDelay: 10 * time.Minute, GroupGracePeriod: 2 * time.Minute, GroupMaxSize: 20, GroupConfigs : map[string]asynq.GroupConfig{ GroupMaxDelay: 5 * time.Minute, GroupGracePeriod: 1 * time.Minute, GroupMaxSize: 30, } }, ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#498
No description provided.