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
Implement wait feature for Rails ActiveJob #97
Comments
Change here: brandonhilkert/rails@972ede1 Can ya'll try this branch for Rails: https://github.com/brandonhilkert/rails/tree/suckerpunch-enqueue_at cc: @davidcpell, @kinnrot, @kevinjalbert |
@brandonhilkert I tested it via a monkey patch and it works. Couldn't swap your branch due to rails v5 dependency conflicts. |
@kevinjalbert Perfect. That should be enough. Thanks! |
Sadly it doesn't appear to be something they want. |
Hey @brandonhilkert, there is any way to walkthrough this? It is a really nice (and needed for us) feature. |
@ngelx what do you mean, walkthrough? |
Sorry @brandonhilkert, there is any way we could use ActiveJob deliver_later i.e. ( MailerX.send_x(some_params).deliver_later( wait: 1.hour) ) or how we could implement something similar?. We are planing to use sucker_punch for testing on heroku, and keeping low cost is necessary for the project. Thanks in advance. |
@ngelx The feature is available by just using the gem itself: https://github.com/brandonhilkert/sucker_punch#perform-in ActiveJob doesn't really get you anything unless you plan to switch processing libraries frequently. |
Currently, ActiveJob allows you to enqueue a job using an options has with keys
wait
andwait_until
:Sucker Punch currently allows this using the following syntax: https://github.com/brandonhilkert/sucker_punch#perform-in
To have this functionality in the ActiveJob adapter, the
enqueue_at
method needs to be implemented. Here is Sidekiq's: https://github.com/rails/rails/blob/master/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb#L27It should be implemented here: https://github.com/rails/rails/blob/master/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb#L26
The text was updated successfully, but these errors were encountered: