Why is the use of ActiveJob::Base enforced? #1219
-
Hello. In With 2 small monkey patches I can very easily disable this check and safely use workers native Sidekiq workers. I'm wondering if there is a reason for this or whether I can raise a small pull request to make this check optional. Here is my code: Monkey patch for RES
ApplicationJob without ActiveJob::Base
The reason I want to use the native Sidekiq workers is because of the much better control around retry logic and job visibility in the Sidekiq web UI. It also means I can have consistency between jobs used in my RES implementation as well as general jobs. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It's an ActiveJob scheduler. It's assuming you always have ActiveJob framework in Rails, when installing Whether you have Sidekiq or not in your project, and whether you want to use it via ActiveJob or directly is up to you. There's nothing in
There's no need to monkey patch at all. You'll want to pass a different scheduler that talks to Sidekiq directly, skipping ActiveJob. There's even 20-LOC-gem released to make it easier: It has a README describing how to pass this dependency:
That scheduler already switches PS. If that's missing in the docs or was hard to find, feel free to change it. I'm going to move this issue to discussions section. |
Beta Was this translation helpful? Give feedback.
-
Just in case — here are the default choices when going with |
Beta Was this translation helpful? Give feedback.
It's an ActiveJob scheduler. It's assuming you always have ActiveJob framework in Rails, when installing
rails_event_store
that depends on Rails. It does not assume what's below ActiveJob facade, that's the whole point of the facade.Whether you have Sidekiq or not in your project, and whether you want to use it via ActiveJob or directly is up to you. There's nothing in
rails_event_store
preventing you from doing this. Quite the contrary.There's no need to monkey patch at all. You'll want to pass a different scheduler that talks to Sidekiq directly, skipping ActiveJob.
There's even 20-LOC-gem released to make it easier:
https://…