-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
ActiveJob, FIFO queues & message_group_id #645
Comments
I think #635 attempts to solves a similar, but distinct, problem with specifying I think these proposals are interesting. If I understand it correctly, you're defining your workers using the When enqueuing a message with Your code snippet offers a workaround by using the job = MyJob.new 'args'
MyJob.queue_adapter.enqueue(job, message_group_id: 'GroupOne') # edit: problems with this code described below It's not well-documented in the wiki that this is possible, and it's not the nicest interface, but I think it'll work for your use case. Let me know if this does what you want. |
Yep! That works and exactly what I was looking for. This would be nice to add in the code snippet under the How does that work? section in the FIFO Queues wiki page. |
Actually, one problem with that snippet is that it work won't if you swap out the ActiveJob queue adapter (for example in your testing environment). I opened #646 which I think addresses the bigger issue. |
I have a question around FIFO queues & the message_group_id with the implementation of ActiveJob. Is there an easy way to set the message_group_id? I've gone over the documentation and can set it using:
but haven't found a short hand way to use this. I've tried the ones mentioned here but no luck with using ActiveJob.
I've been playing around with the
ShoryukenAdapter
to see if there is an easy implementation with ActiveJob. Rails implements the set method on the ActiveJob class but only these options::wait
,:wait_until
,:queue
,:priority
I don't see
priority
being used in the ActiveJob adapter, could we use that?Then implement something like 👇 in the [Active Job adapter]?(https://github.com/phstc/shoryuken/blob/master/lib/shoryuken/extensions/active_job_adapter.rb#L63)
The text was updated successfully, but these errors were encountered: