modules/jooby-netty/src/main/java/org/jooby/internal/netty/NettyServer.java
private void shutdownGracefully(final Iterator<EventExecutorGroup> iterator) {
    if (iterator.hasNext()) {
      EventExecutorGroup group = iterator.next();
      if (!group.isShuttingDown()) {
        group.shutdownGracefully().addListener(future -> {
          if (!future.isSuccess()) {
            log.debug("shutdown of {} resulted in exception", group, future.cause());
          }
          shutdownGracefully(iterator);
        });
      }
    }
  }
private void shutdownGracefully(final Iterator<EventExecutorGroup> iterator) {
    if (iterator.hasNext()) {
      EventExecutorGroup group = iterator.next();
      if (!group.isShuttingDown()) {
        group.shutdownGracefully().addListener(future -> {
          if (!future.isSuccess()) {
            log.debug("shutdown of {} resulted in exception", group, future.cause());
          }
          shutdownGracefully(iterator);
        });
      }
    }
  }
Shutdown executor in order.

@param iterator Executors to shutdown.