If the server environment supports it the client will automatically run asynchronous and allow the server to handle more requests while waiting for the client. In environments such as CGI and FastCGI the client will simply fallback to blocking until it is finished. Multiple client requests will always be handled parallel though and never block each other.
Congrats sri on his progress on Mojo project. I'm really glad my Tatsumaki framework still has a relevant competitor :)
Here's the code to do that non-blocking proxy request in his blog post, as a web handler in Tatsumaki.
It's built on top of Plack and AnyEvent, so it handles multiple requests in parallel non-blockingly and you can use whatever Plack middleware components and AnyEvent aware modules to do non-blocking work, and Tatsumaki also falls back to the blocking mode in Apache, FastCGI and CGI if it makes sense.
You can see more examples of doing I/O bound response, server push (streaming or Multipart XHR) and Comet long-poll in Tatsumaki's eg/ directory.
Recent Comments