Question

I have to develop an API which does some map reduce jobs in the background and then return the results. Its a sinatra application with a Riak No-sql database. The issue is that the job takes around 5-10 minutes to run. And the request times out in that amount of time. What can be the best ways to run such kind of jobs in the background?

Était-ce utile?

La solution

Something like DelayedJob with a layer of something like Redis over the top (to keep track of job state), that is accessed by a unique route (your Sinatra API). Then have a different page (the web page for browser clients) that calls the API via AJAX, polling it periodically.

Autres conseils

you can use the operation system scheduler

windows task scheduler

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top