Closed brandonhilkert closed 9 years ago
Change here: https://github.com/brandonhilkert/rails/commit/972ede1687e5570dc8a955f87234dce9ead9f0d0
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