Non blocking http request

Any one know if it is possible to do a non-blocking http request
within Ror?

I looked at Net::HTTP, nothing obvious.

In my code, I want to fire off a http request (and not care about the
return or wait for it) and continue with the rest of the work.
I know I can use backgroundrb etc - but that seems an overkill.

Any help appreciated.

thanks.

Seriously, checkout delayed_job. It’s super easy to implement, and is
anything but overkill. Here’s the URL for the project:
http://github.com/collectiveidea/delayed_job

… and as an added bonus, Ryan B. covers it in a Railscast. Here’s
the
URL for the Railscast:

http://railscasts.com/episodes/171-delayed-job

Cheers,
Tim

On Thu, Sep 24, 2009 at 4:27 PM, nextpulse [email protected] wrote:

Any help appreciated.

thanks.


Tim L.
Coroutine LLC
516 Tennessee St., Suite 215
Memphis, TN 38103
office: 901.312.8818
mobile: 901.490.5325
http://www.coroutine.com

I agree with Tim on this.

I am working on a new feature in one of my applications that entails
calling a long running process.
I wrote the application to do it synchronously at first to make sure
everything was working.

Then I installed/setup delayed_job, modified my controller to call
@myobject.send_later :my_method and my call was now asynchronous.

Total time to convert from synchronous to asynchronous: < 15 minutes.

Thanks for the info.
delayed_job is a great piece but its just an overkill for what i
wanted.
I wanted something simple - not just from an implementation standpoint

  • but resource too (not add any extra load etc).

“Keep in mind that each worker will check the database at least every
5 seconds.”

For those who are interested, a solution was to use ruby system
(’…&’). I fire it off (and forget) and let the OS mange it. (If
needed, you can also manage the queues via ruby Process)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs