public void stop() {
    stopThreads.set(true);

    executorService.shutdown();
    try {
      while (!executorService.awaitTermination(60, TimeUnit.SECONDS)) {
        LOGGER.warn("Waiting for thread-pool to terminate");
      }
    } catch (InterruptedException e) {
      LOGGER.warn("Interrupted while waiting for thread-pool termination", e);
    }
  }
This generates {@link KeyPress} objects from the given input stream and offers them to the given
queue.
hbase-hbtop/src/main/java/org/apache/hadoop/hbase/hbtop/terminal/impl/KeyPressGenerator.java