0

I have a system with many users. Every user is allowed to do 1 action at a time. I want to create a "different" queue for every user. So let's say I push

{user: 1, todo: 'Get Money'}

{user: 1, todo: 'Get Pizza'}

{user: 1, todo: 'Get a car'}

{user: 2, todo: 'Get Money'}

{user: 2, todo: 'Get a car'}

I have basically created two queues.

Let's assume I have 2 or more workers. Only one worker will work per queue.

I am trying to find a queue system that can do it without using an external database.

Which queue system could handle it the best?

Nevo David
  • 49
  • 1
  • 7
  • Look at temporal.io. It would solve your problem much more elegantly than a queue. Here is a post explains how it can be used to solve a similar problem: https://stackoverflow.com/questions/56263335/job-queue-with-job-affinity/56615120#56615120 – Maxim Fateev Feb 14 '21 at 19:45