@PostConstruct
    @Override
    public void init() {
        logger.info("server init");
        int cpus = Runtime.getRuntime().availableProcessors();

        defaultGroup = new DefaultEventLoopGroup(8, new ThreadFactory() {
            private AtomicInteger index = new AtomicInteger(0);

            @Override
            public Thread newThread(Runnable r) {
                return new Thread(r, "DEFAULTGROUP" + index.incrementAndGet());
            }
        });

        bossGroup = new NioEventLoopGroup(cpus, new ThreadFactory() {
            private AtomicInteger index = new AtomicInteger(0);

            @Override
            public Thread newThread(Runnable r) {
                return new Thread(r, "BOSSGROUP" + index.incrementAndGet());
            }
        });

        workGroup = new NioEventLoopGroup(cpus * 10, new ThreadFactory() {
            private AtomicInteger index = new AtomicInteger(0);

            @Override
            public Thread newThread(Runnable r) {
                return new Thread(r, "WORKGROUP" + index.incrementAndGet());
            }
        });

        bootstrap = new ServerBootstrap();
        executorService = Executors.newScheduledThreadPool(2);
    }
@Author : ChinaLHR
@Date : Create in 15:06 2017/10/22
@Email : 13435500980@163.com
quark-chat/src/main/java/com/quark/chat/server/QuarkChatServer.java