Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在麻烦中阅读netty的源代码_Netty - Fatal编程技术网

在麻烦中阅读netty的源代码

在麻烦中阅读netty的源代码,netty,Netty,我正在阅读Netty 4.0.10.Final的源代码。 在AbstractChannel.AbstractUnsafe类中 private void invokeLater(Runnable task) { // This method is used by outbound operation implementations to trigger an inbound event later. // They do not trigger an inb

我正在阅读Netty 4.0.10.Final的源代码。 在AbstractChannel.AbstractUnsafe类中

    private void invokeLater(Runnable task) {
        // This method is used by outbound operation implementations to trigger an inbound event later.
        // They do not trigger an inbound event immediately because an outbound operation might have been
        // triggered by another inbound event handler method.  If fired immediately, the call stack
        // will look like this for example:
        //
        //   handlerA.inboundBufferUpdated() - (1) an inbound handler method closes a connection.
        //   -> handlerA.ctx.close()
        //      -> channel.unsafe.close()
        //         -> handlerA.channelInactive() - (2) another inbound handler method called while in (1) yet
        //
        // which means the execution of two inbound handler methods of the same handler overlap undesirably.
        eventLoop().execute(task);
    }
这些评论使我困惑。 为什么出站事件会立即触发入站事件。 有人能给我解释一下细节吗?谢谢

(我已经回答了这个问题,但我再次回答是为了完成这个条目。)


注释所说的基本上是,我们希望确保同一处理程序中处理程序方法的执行不会重叠。如果没有
invokeLater()
handlerA.channelInactive()
甚至在
handlerA.inboundBufferUpdated()
返回之前都会被调用。

是否有一个netty developer邮件列表?那也许是个更好的提问的地方。你明白了: