为什么Netty服务端启动时ServerBootstrapAcceptor的添加要放到线程中?
ServerBootstrap的init()方法中,有这样一段逻辑:
1if(handler != null) { pipeline.addLast(handler);}ch.eventLoop().execute(newRunnable() { @Overridepublicvoidrun() { pipeline.addLast(newServerBootstrapAcceptor( ch, currentChildGroup, currentChildHandler, currentChildOptions, currentChildAttrs)); }});
为什么对ServerBootstrapAcceptor的添加,要放到线程中执行,而不是直接同步添加?