Netty的同步方式阻塞主线程

当我们在该函数中直接调用下面的代码时:

channelFuture.channel().closeFuture().sync();

Netty会进入无限循环之中,将会不再加载和扫描之后的类了。有可能你还需要mybatis、redis等,可能就扫描不到

我的处理方式是继承Runnable,然后启动新的进程跑netty的server端

new Thread(delimiterBaseServer).start();

 

相关资料:

https://blog.csdn.net/qq_38132901/article/details/102819557?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

 

https://www.cnblogs.com/zhxiansheng/p/10789114.html

 

https://blog.csdn.net/weixin_34205076/article/details/92436309

相关文章:

  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-08
  • 2022-01-12
  • 2021-11-29
  • 2021-08-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-05
  • 2022-02-12
  • 2021-04-01
  • 2021-06-07
  • 2021-07-10
相关资源
相似解决方案