code: public static synchronized void releaseSharedResources(long timeout, TimeUnit unit) {
          if (EVENT_LOOP != null) {
              try {
                  EVENT_LOOP.shutdownGracefully().await(timeout, unit);
              } catch (InterruptedException e) {
                  LoggerFactory.getLogger(Stack.class)
                          .warn("Interrupted awaiting event loop shutdown.", e);
              }
              EVENT_LOOP = null;
          }
  
          if (SCHEDULED_EXECUTOR_SERVICE != null) {
              SCHEDULED_EXECUTOR_SERVICE.shutdown();
              SCHEDULED_EXECUTOR_SERVICE = null;
          }
  
          if (EXECUTOR_SERVICE != null) {
              EXECUTOR_SERVICE.shutdown();
              EXECUTOR_SERVICE = null;
          }
  
          if (WHEEL_TIMER != null) {
              WHEEL_TIMER.stop().forEach(Timeout::cancel);
              WHEEL_TIMER = null;
          }
      }
docs: Release shared resources, waiting at most the specified timeout for the {@link NioEventLoopGroup} to shutdown
  gracefully.
  
  @param timeout the duration of the timeout.
  @param unit    the unit of the timeout duration.