protected boolean shutdown(long timeout, TimeUnit timeUnit) throws InterruptedException {
    logger.trace("Shutting down AsyncRequestWorker");
    running.set(false);
    requests.offer(new AsyncRequestInfo(null, null));
    return shutdownLatch.await(timeout, timeUnit);
  }
Marks that shutdown is required and waits for the shutdown of this instance for the specified time.
<p/>
All requests still in the queue will be discarded.
@param timeout the amount of time to wait for shutdown.
@param timeUnit time unit of {@code timeout}.
@return {@code true} if shutdown succeeded within the {@code timeout}. {@code false} otherwise.
@throws InterruptedException if the wait for shutdown is interrupted.
ambry-rest/src/main/java/com/github/ambry/rest/AsyncRequestResponseHandler.java