-
Notifications
You must be signed in to change notification settings - Fork 124
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 concurrency keys #182
Comments
Yes, that's right, you can only specify a single concurrency key per job.
🤔 It depends on your case, but would it work just to limit on the |
In terms of concurrency yes, that would be enough. But we are using one concurrency key to make sure identical jobs don't even get enqueued, just to not do unneccessary work, similar to the So maybe my question isn't about multiple concurrency keys, but rather how do I make sure to not enqueue duplicate jobs. And maybe #105 will solve this! |
Ahh got it. I think #176 might not quite work for your case, then, because it'd still be just with a single concurrency key; the only difference would be that you could choose what to do if more than one job is enqueued, but either by all arguments or by the customer. For Solid Queue, I think having more than one concurrency key per job adds too much overhead in the way this is implemented with semaphores (the best way we could come up with, considering our database constraints), so I don't see that being added in the near future, at least not in the way this works now 😞 |
About #105, yeah, that would work if we do something else, different to #176. I still haven't made up my mind on that one 😅 For example, in your case, if a job is scheduled in the future, do you allow other jobs to be enqueued with the same arguments before that other job is due? Or is it not allowed at all, even if the scheduled job is not due yet? |
@rosa - maybe it is worth designing in public on this. For handling of your above situation, my implementation instinctively would be: In the future, one could easily wrap the above with some syntactic sugar to handle common cases. |
We are migrating to Solid Queue and trying to find out how to support our use case:
We currently use sidekiq and a custom currency control that makes sure there is always 1 job running per customer, and only 1 job with the same arguments. We do this by having multiple concurrency keys, and I was hoping I could do something similiar with Solid Queue, eg:
If I understood correctly, there is only one concurrency key per job in Solid Queue? Would I be able to do it in another way? Thanks in advance! ❤️
The text was updated successfully, but these errors were encountered: