문제

I am new to Netty. I am trying to find out if all the handlers in a Channels's pipeline are managed by a single worker thread. In that case won't the worker thread be locked by the handlers to finish. Or is each handler handled by different available worker threads ?

Thanks,

Sudha

도움이 되었습니까?

해결책

Each handler of a Channel is executed in the worker thread by default. So if you need todo any blocking work you need to todo it in an other Thread. How you do this depends on if you use netty 3 or netty 4.

In netty 3 you would use the ExecutorHandler. In netty 4 you would specify an other EventExecutor when adding the ChannelHandler to the ChannelPipeline.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top