I'm kinda new to async web servers. I just started playing with webbit (via webbit-rest) and I'm having difficulty in processing simultaneous requests that take a while.
I know I'm not supposed to block in the handler, so I wrote an example like this:
In this case, I'm creating a worker thread to simulate doing something expensive (like a DB call) and I'm passing a runnable to the NettyServer's executor when done to set the response body and "end" it.
However, when I make two requests at the same time, the spread across them is 4 seconds (instead of the expected 2), even though the handleHttpRequest method in both returns immediately. Is there any way to get the webbit server to do two things at once, or must all requests be processed entirely in-order?