title: How to set request timeout in vertx webclient
body: <p>I am trying to setup requestTimeout in vert.x web-client. But its not working as expected. </p>
  
  <p>An api with &lt; 10ms response time is timing out from webclient with 100ms requestTimeout set. Both the server and client are running on my local machine.  </p>
  
  <pre><code>@Test
    public void connectionTimeOut() throws InterruptedException {
      WebClient  client = WebClient.create(Vertx.vertx());
      client.request(HttpMethod.GET,8000 , "localhost", "/scripts/").timeout(100).send(ar -&gt; {
        if (ar.succeeded()) {
          System.out.print("Request  succeded");
  
        } else {
          ar.cause().printStackTrace(); ;
        }
      });
  
      TimeUnit.MINUTES.sleep(20);
    }
  </code></pre>
  
  <pre><code>java.util.concurrent.TimeoutException: The timeout period of 100ms has been exceeded while executing GET /scripts/ for host localhost
      at io.vertx.core.http.impl.HttpClientRequestBase.timeout(HttpClientRequestBase.java:183)
      at io.vertx.core.http.impl.HttpClientRequestBase.handleTimeout(HttpClientRequestBase.java:168)
      at io.vertx.core.http.impl.HttpClientRequestBase.lambda$setTimeout$0(HttpClientRequestBase.java:126)
      at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:870)
      at io.vertx.core.impl.VertxImpl$InternalTimerHandler.handle(VertxImpl.java:829)
      at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:344)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute$$$capture(AbstractEventExecutor.java:163)
      at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java)
      at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
      at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
      at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
      at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>The same code works if I set requestTimeout to 1000ms. Please let me know if there is any workaround for this or if I am missing something.</p>