title: Undertow how to do Non-blocking IO?
body: <p>I am using Undertow to create a simple application.</p>
  
  <pre><code>public class App {
      public static void main(String[] args) {
          Undertow server = Undertow.builder().addListener(8080, "localhost")
                  .setHandler(new HttpHandler() {
  
                      public void handleRequest(HttpServerExchange exchange) throws Exception {
                          Thread.sleep(5000);
                          exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
                          exchange.getResponseSender().send("Hello World");
                      }
  
                  }).build();
          server.start();
      }
  }
  </code></pre>
  
  <p>I open a browser tab on <code>localhost:8080</code> and I open a second
   tab also on <code>localhost:8080</code></p>
  
  <p>This time the first tab will wait 5 seconds, and the second will wait 10 seconds</p>
  
  <p>Why is it so?</p>