4 ms·
The data is being written to the db, or being crunched, while the request is ending, and the browser can continue with the important stuff. It sounds like a go
by julian37 14y ago
The data is being written to the db, or being crunched, while the request is ending, and the browser can continue with the important stuff.
It sounds like a good fit for NodeJS for sure, but for what it's worth, even in a synchronous web framework nothing forces you to keep the connection open until the request has been processed.
I don't know off-hand how to do it in Rails, but say in Java Servlet-based frameworks you'd just call HttpServletResponse.close().
- heroic 14y agoThe point is that the rack middleware would be called for everything, which is very heavy for something so trivial
- cmelbye 14y agoOf course, it's trivial to write request methods that bypass the rack middleware in Rails.
- julian37 14y agoI didn't mean to imply that NodeJS isn't the best fit for the problem at hand. I was just trying to clarify that it doesn't take an asynchronous framework like Node to keep processing a request after the connection is closed.
- mike-cardwell 14y agoYeah, even with a simple Perl CGI, all you have to do is close STDOUT if you want the HTTP response to end, but continue processing the request.