Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Netty 的新手。我试图找出通道管道中的所有处理程序是否由单个工作线程管理。在这种情况下,工作线程不会被处理程序锁定以完成。或者每个处理程序是否由不同的可用工作线程处理?
谢谢,
苏达
默认情况下,Channel 的每个处理程序都在工作线程中执行。所以如果你需要做任何阻塞工作,你需要在另一个线程中做。如何执行此操作取决于您使用的是 netty 3 还是 netty 4。
在 netty 3 中,您将使用 ExecutorHandler。在 netty 4 中,您将在将 ChannelHandler 添加到 ChannelPipeline 时指定另一个 EventExecutor。