Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Sinatra job in background?

When responding to a request, is it possible to send the response and then continue processing?

Or do you need to run a background process? What is the simplest solution?

Sinatra app on Heroku, Ruby 1.9.3.

like image 783
B Seven Avatar asked Dec 08 '12 01:12

B Seven


1 Answers

You can have another thread running, see for example:

http://mark-watson.blogspot.com/2011/11/ruby-sinatra-web-apps-with-background.html

like image 138
Diego Basch Avatar answered Sep 26 '22 03:09

Diego Basch