<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
concerning handling of downstream events coming from multiple pipelines:<br>
I suppose we should forward all of them in incoming order.<br>
<br>
changing bootstrap is just an idea. this could also be done on the
pipeline.<br>
that is pipeline or maybe pipeline factory could implement the
composite pattern.<br>
(<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Composite_pattern">http://en.wikipedia.org/wiki/Composite_pattern</a>) <br>
Currently the problem that I have with pipeline is that the only 
pipeline implementation is <br>
attached to a channel and a sink. For composite pattern to work I must
be able to create a pipeline<br>
which is independent of a channel and then add it to a
DefaultChannelPipeline. I must be able to remove it from<br>
a "channeled" pipeline and add it to another pipeline.<br>
<br>
My idea is to have a class:<br>
<br>
class ChannelLessPipeline implements  ChannelPipeline<br>
<br>
That is a pipline where getChannel returns null.<br>
<br>
and the methods:<br>
<br>
ChannelPipeline.addxxx(ChannelPipeline)<br>
<br>
xxx == First, Last, Before, ....<br>
<br>
ChannelPipeline.remove(ChannelPipeline)<br>
<br>
ChannelPipeline.getPipeline(String pipelineName)<br>
ChannelPipeline.removePipeline(String pipelineName)<br>
<br>
ChannelPipeline.set/getName(String)<br>
<br>
ChannelPipeline.get("channelName/handlerName")<br>
<br>
<br>
Using the composite will make it easier to use building blocks.<br>
For example we could have an HttpPipeline which contains the http
encoder/decoder/chunck... implemented within a web server project.<br>
We could use this within a webdav pipeline. or within a jaxta pipeline.<br>
<br>
<br>
Concerning parallel pipelines. what I mean is not parallel in the sense
of threading but in the sense of event flow.<br>
For this one could foresee a pipline implementation:<br>
<br>
ParallelChannelPipeline<br>
<br>
where the add method adds in parallel and not in sequence.<br>
<br>
Thus a handler could always get the original ChannelBuffer by sending
it on a parallel pipeline which has a handler which just stores it.
(similar to a rail holding track)<br>
If a handler requires the buffer it could access this holding track.<br>
This could be used not just for the incoming buffer but for any message
sent through the pipeline.<br>
<br>
Be aware that this are just preliminary ideas.<br>
<br>
I have implemented something similar to composite pattern within my
async hessian patch. <br>
<br>
org.rzo.netty.ahessian.session.MixinPipeline<br>
<br>
take a look at and its usage. This may make things clearer.<br>
<br>
The current implementation avoids changing the netty implementation.<br>
However it would be "nicer" if netty provided built-in pipeline
composition.<br>
<br>
The idea, in async hessian is that whenever a client joins his session
the client's previous pipeline is added to the pipeline of the channel.<br>
The client can thus disconnect and reconnect multiple times and will
always find the same "partial" pipeline (therefore state) on the server.<br>
When the sub-pipeline is removed it is "detached" from the channel.
When it is added to a new pipeline it is "attached" to its channel.<br>
<br>
Concerning your proposal to subversion the hessian implementation: That
would be great. I hope to find someone to review the code.<br>
Do you have a proposal for the package name ?<br>
<br>
-- Ron<br>
<br>
<br>
<br>
On 25.01.2010 10:17, "Trustin Lee (이희승)" wrote:
<blockquote cite="mid:4B5D61B6.3040803@gmail.com" type="cite">
  <pre wrap="">Hello Ron,

If a pipeline is parallelized, how do we determine which event from
multiple sub-pipelines should be forwarded to the next joined pipeline?

What about implementing it as a separate ChannelPipeline implementation
instead of modifying Bootstrap?

Thanks for a cool idea!
Trustin

rzo wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hello,

with this post I would like to initiate a discussion on enhancements for 
pipeline.

Within my asynch hessian patch I have implemented a "MixinPipeline".
That is an implementation of a Pipeline, which allows to insert a 
pipeline or remove a pipeline
to/from an existing pipeline.

Another idea I had for the "WAF" example which I posted was to implement 
"parallel" pipelines.
eg the ability to send an incoming buffer along multiple parallel 
pipelines, synchronize their processing, etc.

I think that implementing generic methods/classes for this kind of 
operations would be great and will enable
to use building blocks within netty. It will also enable to use existing 
pipeline factories from other applications by
just combining them. Something in the line of:

bootstrap.addLastPipelineFactory("httpTunnelServerPipeline", ...)
bootstrap.addParallelPipelineFactory("httpTunnelServerPipeline", 
"wafPipeline", ...)
bootstrap.addLastPipelineFactory("asycHessianServerPipeline", ...)

What do you think ?

-- Ron



_______________________________________________
netty-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a>
    </pre>
  </blockquote>
  <pre wrap="">
  </pre>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
netty-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/netty-users">https://lists.jboss.org/mailman/listinfo/netty-users</a></pre>
</blockquote>
<br>
</body>
</html>