views:

358

answers:

3

I'd like to run a basic asynchronous job

exec('curl -0 '+url)

from a sinatra app,

I've tried to do that with fork and detach but it seems bogus.

(I'm on windows)

+1  A: 

What about trying:

exec('curl -0'+url) if fork == nil
Edu
it doesn't seem to work but for a reason I don't quite understand, it works with Thread.new { exec('curl -O'+url) }
Gaetan Dubar
+2  A: 

Hi, there's and example application from Blake Mizerany at Github: sinatra-dj, using DelayedJob as queing mechanism.

karmi
thanks that's exactly what I was looking for, the sinatra-dj example is really straitforward
Gaetan Dubar
A: 

Old question, but...

Use Spork

ehsanul