Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple queues with same job handler #73

Open
rumo777 opened this issue Mar 12, 2021 · 1 comment
Open

Multiple queues with same job handler #73

rumo777 opened this issue Mar 12, 2021 · 1 comment

Comments

@rumo777
Copy link

rumo777 commented Mar 12, 2021

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

@HigoRibeiro
Copy link
Contributor

Hi @rumoru.
I'll check that out, but I think you're right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants