質問

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