code: public void startServer() {
          EventLoopGroup bossGroup = new NioEventLoopGroup();
          EventLoopGroup workerGroup = new NioEventLoopGroup();
          try {
              synchronized (HTTP_SERVER_START_STOP_LOCK) {
                  ServerBootstrap b = new ServerBootstrap();
                  b.group(bossGroup, workerGroup)
                          .channel(NioServerSocketChannel.class)
                          .childHandler(new DefaultInitializer())
                          .option(ChannelOption.SO_BACKLOG, Config.getBacklog())
                          .option(ChannelOption.SO_REUSEADDR, true);
                  LOG.info("[Netty httpServer]  About to bind and start to accept incoming connections on port " + Config.getPort());
                  parentChannel = b.bind(Config.getPort()).sync().channel();
                  LOG.info("[Netty httpServer]  Started on port " + Config.getPort());
              }
              parentChannel.closeFuture().addListener(future -> {
                  LOG.debug("until the server socket is closed.");
                  LOG.info("[Netty httpServer] 准备shutdown netty server");
                  bossGroup.shutdownGracefully();
                  workerGroup.shutdownGracefully();
                  LOG.info("[Netty httpServer] netty server shutdown完毕!");
              });
          } catch (Throwable e) {
              LOG.error("http netty server 启动失败!", e);
          }
      }
docs: 异步