Send some preliminary data in a rails response -
Send some preliminary data in a rails response -
in rails, possible send response browser in 2 parts? first part doesn't need specific (reason explained below). sec part of response total normal response such view in .html.erb format.
the reason i'm looking heroku requires response sent browser within 30 seconds, it's taking longer 30 seconds app perform several dozen calculations on 1.2 1000000 records.
the heroku documentation indicates may possible platforms (but possible rails?): https://devcenter.heroku.com/articles/limits
http requests have initial 30 sec window in web process must homecoming response info (either completed response or amount of response info indicate process active). processes not send response info within initial 30-second window see h12 error in logs.
p.s.- recognize there may improve platforms rails build kind of data-intensive app, i'm building in rails because that's know.
thanks!
the right way this, on heroku, background jobs. if don't want pay dyno, there some hacks out there might work you.
if need hack together, streaming api should work. should able write blank space every 30 seconds until work complete. maintain in mind you'll need way interrupt long running task send response. means ruby version supports threading.
if you're doing reading lot of records db, can use find_each
streaming.
ruby-on-rails ruby-on-rails-3 heroku
Comments
Post a Comment