netty/netty — Issue #66: Chained pipelines
Author: trustin
Created: 2011-11-18 00:43:24+00:00
State: open
Labels: feature

`ChannelPipeline` is basically a list of `ChannelHandler`s. An event is executed sequentially. However, this is not enough for the applications that require more omplex event flow such as Web Server.

For example, a user might want different pipelines handle an HttpRequest for different URI patterns.

Common Pipeline ---- if URL matches /websocket ---- WebSocket pipeline
---- If URL matches /pages ---- Static page pipeline
---- Otherwise --- Redirect-to-home pipeline

There are a couple changes required to make this work:

* `ChannelPipeline` implements `ChannelSink` so that a downstream event is propagated to the previous pipeline
* Move `Channel.write()` and other method that triggers a downstream event to `ChannelHandlerContext' because Netty cannot determine from which pipeline it is firing a downstream event.