Skip to content
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

Closed
brandonhilkert opened this issue Jan 29, 2015 · 8 comments
Closed

Implement wait feature for Rails ActiveJob #97

brandonhilkert opened this issue Jan 29, 2015 · 8 comments

Comments

@brandonhilkert
Copy link
Owner

Currently, ActiveJob allows you to enqueue a job using an options has with keys wait and wait_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#L27

It should be implemented here: https://github.com/rails/rails/blob/master/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb#L26

@brandonhilkert
Copy link
Owner Author

@kevinjalbert
Copy link

@brandonhilkert I tested it via a monkey patch and it works. Couldn't swap your branch due to rails v5 dependency conflicts.

@brandonhilkert
Copy link
Owner Author

@kevinjalbert Perfect. That should be enough. Thanks!

@brandonhilkert
Copy link
Owner Author

Sadly it doesn't appear to be something they want.

rails/rails#18726

@ngelx
Copy link

ngelx commented Apr 20, 2015

Hey @brandonhilkert, there is any way to walkthrough this? It is a really nice (and needed for us) feature.

@brandonhilkert
Copy link
Owner Author

@ngelx what do you mean, walkthrough?

@ngelx
Copy link

ngelx commented Apr 20, 2015

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.

@brandonhilkert
Copy link
Owner Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants