ChannelPipeline javadoc suggestion

grhwood at gmail.com grhwood at gmail.com
Thu Sep 22 14:22:10 EDT 2011


Hi,

When i first read the ChannelPipeline javadoc and with regard to the 
evaluation order of ChannelUpstreamHandler & ChannelDownstreamHandler: 
bottom up for ChannelUpstreamHandler and top-down for 
ChannelDownstreamHandler which conflict with what Netty handle 
ChannelHandler:  from head to tail with upstream and tail to head with 
downstream . So I suggest to change the diagram: reverse the diagram to 
make it easier to remember the evaluation order of ChannelHandler:

  * <pre>
  *  +-------------+--------------------------+---------------+
  *  |             |                          |               |
  *  |     [ Socket.read() ]          [ Socket.write() ]      |
  *  |                                                        |
  *  |  Netty Internal I/O Threads (Transport Implementation) |
  *  +--------------------------------------------------------+
  *                |                         /|\
  *  +----------------------------------------+---------------+
  *  |             |    ChannelPipeline       |               |
  *  |            \|/                        /|\              |
  *  |  +----------------------+  +-----------+------------+  |
  *  |  | Upstream Handler  1  |  | Downstream Handler  1  |  |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |             |                          |               |
  *  |            \|/                        /|\              |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |  | Upstream Handler  2  |  | Downstream Handler  2  |  |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |            \|/                         .               |
  *  |             .                          .               |
  *  |     [ sendUpstream() ]        [ sendDownstream() ]     |
  *  |     [ + INBOUND data ]        [ + OUTBOUND data  ]     |
  *  |             .                          .               |
  *  |             .                         /|\              |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |  | Upstream Handler N-1 |  | Downstream Handler M-1 |  |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |            \|/                         |               |
  *  |             |                         /|\              |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |  | Upstream Handler  N  |  | Downstream Handler  M  |  |
  *  |  +----------+-----------+  +-----------+------------+  |
  *  |                                        |               |
  *  +-------------+--------------------------+---------------+
  *                                          /|\
  *                                       I/O Request
  *                                  via {@link Channel} or
  *                              {@link ChannelHandlerContext}
  * </pre>

What is your opinion ?




More information about the netty-users mailing list