mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #493] [FEATURE REQUEST] Multiple queues with different workers #224
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#224
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zerozh on GitHub (Jun 18, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/493
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
As the document described, the
queueconcept in asynq is actuallypriority. All tasks in different queues share the workers specified in Config.Describe the solution you'd like
With my scenario, I want the queue to be namespace, or a group of tasks. For example, I have different types of tasks(
order/sms/mailetc) and they have their own workers(order: 10, sms: 2, mail: 2). These workers only consume the "queue" they want to deal with. That said, we only have 2 workers to run the mail tasks in parallel in case high concurrent traffics.Describe alternatives you've considered
I can start different executable programs with different configs.
I have to monitor several programs on my own with this alternatives. Instead, if asynq could provide the feature it would be great.
Additional context
@hibiken commented on GitHub (Jun 19, 2022):
@zerozh Thank you for creating this issue! I'll consider adding an option to limit the concurrency for each queue.
In the meantime, we could use the approach you suggested with a single executable:
You could create a
asynq.Serverobject for each queue with the desired concurrency and start all servers in one main.Note: API is a little awkward (maybe we should consider moving
Handlerto be a part ofConfig), but this should work.Example:
Let me know if you have feedback or questions.
@zerozh commented on GitHub (Jun 21, 2022):
@hibiken Thanks for the code snippet! That's super helpful.
@xylomo commented on GitHub (Jun 27, 2022):
@hibiken was this actually complete or is expected to use the multiple server approach?