Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deferred/async task with Rails

I have an action in which I send a request to a web service. The web service takes FOREVER to respond and my users are waiting ages to get a response back from us.

The web page that I display to the user is NOT dependent upon the response from the web service. I'd like my request to the web service to be deferred/asynchronous so that my users don't have to wait for the roundtrip to the web service.

What should I do? What's the best way to handle this?

Thanks for your help!

like image 879
Michael Avatar asked Mar 22 '26 16:03

Michael


1 Answers

Check out https://github.com/defunkt/resque. It's a delayed job library for doing exactly what you need. Built by one of the Github founders and a lot of people are known to use it.

An alternative would be https://github.com/collectiveidea/delayed_job

like image 112
Josh Deeden Avatar answered Mar 25 '26 07:03

Josh Deeden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!