adonis-bull
adonis-bull copied to clipboard
Multiple queues with same job handler
Thank you for your work.
Correct me if I am wrong but it seems that this implementation makes 1 to 1 relation between JobContract and Queue it is running against (Adonis 5).
Here is an example of a use case: upload file and process every single line. So job would be - single line processing. All lines are added to the queue. Now I want to upload second file at the same time, but it is added to the same queue. It would be great that they had their own queues, so one could stop/pause, monitor progress of each file being processed.
I tried
export default class MyJob implements JobContract {
constructor(key) {
this.key = key
}
}
So it assigns queue key on Job creation. But no luck, and digging deeper it seems that all Job classes are instantiated once and mapped to keys they have on boot.
Hope that makes sense. Maybe it is possible and I missing something.
Cheers
Hi @rumoru. I'll check that out, but I think you're right