Reputation: 947
Using SideKiq as the backend.
Is there anyway to get access to ActiveJob's queue or SideKiq's queue through ActiveJob?
Docs seem silent on the subject.
Upvotes: 2
Views: 440
Reputation: 12719
ActiveJob documentation doesn't help much indeed, but if you take a look at the sources, it's pretty simple to find how everything is done.
ActiveJob offers support for different adapters so it'd be difficult to implement an access to the queue itself in an unified way. Some adapters (e.g. Backburner) allow the use of quite old backend which may not support access to the queue (with the same example, it was the case of beanstalk).
Moreover, it's generally up to the business logic to know whether or not a job has been enqueued or not.
However, you can easily see the interconnection between ActiveJob and SideKiq in this file. It's then up to you to decide if you really need this and then access the SideKiq queue directly.
Upvotes: 1