[GH-ISSUE #522] How to create a queue based on user id #244

Open
opened 2026-03-02 05:19:54 +03:00 by kerem · 3 comments
Owner

Originally created by @yogasw on GitHub (Jul 25, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/522

how can I create a queue based on the user id with the same task type
example

USER A has a list of tasks 1,2,3
USER B has a list of tasks 4,5,6
USER C has a task list of 7,8,9

it should be like this

  1. A 1
  2. B 4
  3. C 7

It's not like this

  1. A 1
  2. A 2
  3. A 3

conditions are

  1. One user can only run one task at the same time
  2. Maximum Concurrency is 10
  3. Only one task type
Originally created by @yogasw on GitHub (Jul 25, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/522 how can I create a queue based on the user id with the same task type example USER A has a list of tasks 1,2,3 USER B has a list of tasks 4,5,6 USER C has a task list of 7,8,9 it should be like this 1. A 1 2. B 4 3. C 7 It's not like this 1. A 1 2. A 2 3. A 3 conditions are 1. One user can only run one task at the same time 2. Maximum Concurrency is 10 3. Only one task type
Author
Owner

@archit-harness commented on GitHub (Sep 16, 2022):

@arioki1 did you find any solution to this?
I want to have 10k queues based on userId, and dequeue can be from any given queue given as input and not creating consumer server for each queue.

<!-- gh-comment-id:1249326603 --> @archit-harness commented on GitHub (Sep 16, 2022): @arioki1 did you find any solution to this? I want to have 10k queues based on userId, and dequeue can be from any given queue given as input and not creating consumer server for each queue.
Author
Owner

@armoona commented on GitHub (Sep 22, 2022):

I have the same question. Can I have a million queues? Think of an app with a million users; each user sends a sequence of commands; each user's sequence must be executed sequentially.

<!-- gh-comment-id:1255058683 --> @armoona commented on GitHub (Sep 22, 2022): I have the same question. Can I have a million queues? Think of an app with a million users; each user sends a sequence of commands; each user's sequence must be executed sequentially.
Author
Owner

@yogasw commented on GitHub (Dec 18, 2022):

I haven't found the best solution for this case @archit-harness ,
for my previous case I could only combine all requests into one queue,
I don't have a solution yet to queue according to user id

<!-- gh-comment-id:1356812857 --> @yogasw commented on GitHub (Dec 18, 2022): I haven't found the best solution for this case @archit-harness , for my previous case I could only combine all requests into one queue, I don't have a solution yet to queue according to user id
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#244
No description provided.