Replies: 2 comments 4 replies
-
Since jobs are workers agnostic you cannot bind a set of jobs to a particular worker in BullMQ. I am not sure if you know a about flows? maybe they are useful to you somehow: https://docs.bullmq.io/guide/flows |
Beta Was this translation helpful? Give feedback.
2 replies
-
I have an idea. What if I have several queues, one for each machine? When the job needs to be started, I will add it to the queue (machine) with the least number of active jobs. The workers on a single machine will only be watching one queue, the one for that machine. Will that work? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a long process that is made of 5 steps. The steps need to be executed on the same machine where the process started. Independent processes could be executed on different computers for scalability.
Let me give you an example.
I have this long process that is made of five steps: A-B-C-D-E
I am running my application on two computers: 1 and 2.
When the process executes on computer 1, I will be doing steps A1-B1-C1-D1-E1.
When the process executes on computer 2, I will be doing steps A2-B2-C2-D2-E2.
The steps could take a long amount of time to complete because I need to wait for other servers to do their job, so when BullMQ wakes a particular job, I look at which step needs to be done and I execute that step once the step is completed, then I put the job to sleep for 30 seconds.
I must prevent this situation: A1-B1-C2-D2-E1.
How can I do that?
Beta Was this translation helpful? Give feedback.
All reactions