timgit / pg-boss

Queueing jobs in Node.js using PostgreSQL like a boss
MIT License
1.73k stars 144 forks source link

sub queues or queue groups #446

Open dimonnwc3 opened 1 month ago

dimonnwc3 commented 1 month ago

Let's say I have a queue "encode" which has long running tasks. Many users can submit many tasks. I want to load balance tasks between users, by e.g a special "group" key so that one user can't block others for a long time.

10:30 user A submits 10 "encode" tasks 10:31 user B submits 10 "encode" tasks Then user B will wait for all 10 tasks from user A to finish <- I want to prevent this

here is an example of such feature in bullmq: https://docs.bullmq.io/bullmq-pro/groups

is this possible to do and how?