[英]Is it true that Netty provides non-blocking IO only for network?
Is my understanding correct that Netty provides non-blocking io (NIO) only for network? 我的理解正确吗,Netty仅为网络提供了非阻塞io(NIO)? And if you want to make a blocking io (ie database query), you have to use executer from ChannelHandlerContext in order to not to block EventLoop?
而且,如果要进行阻塞io(即数据库查询),则必须使用ChannelHandlerContext中的executer才能不阻塞EventLoop?
Is my understanding correct that Netty provides non-blocking io (NIO) only for network?
我的理解正确吗,Netty仅为网络提供了非阻塞io(NIO)?
It would be more accurate to say that Java only provides non-blocking I/O for network channels. 准确地说Java只为网络通道提供非阻塞I / O。 See the list of classes which extend
SelectableChannel
. 请参阅扩展
SelectableChannel
的类列表。
And if you want to make a blocking io (ie database query), you have to use executer from
ChannelHandlerContext
in order to not to block EventLoop?而且,如果要进行阻塞io(即数据库查询),则必须使用
ChannelHandlerContext
中的executer才能不阻塞EventLoop?
Yes. 是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.