cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject [RT] Sources and Drains
Date Thu, 21 Feb 2002 12:32:38 GMT
[For those of you who didn't study elettronic, MOSFET transistors have
sources, drains and gates. Sources generate electrons, drains consume
them and gates control the flow]

The original idea of a pipeline was

 g -> t* -> s

you all know this very well.

Then I realized that the same pipelines shared the same properties, so I
came up with the notion of resource views, which required a way to 'get
out' of the normal pipeline flow. This was implemented with 'views' and

 g -> t* -> s

 [label] -> t* -> s

so that we could ask for a specific 'view' and do something like

 g -> t -> t* -> s [normal view]
      + -> t* -> s [another view]

Then we wanted to merge different pipelines with 'aggregation', so we
needed a way to do something like

 g -> t* -> A -> t* -> s
 g -> t* ---+

this created the notion of 'internal pipelines', those pipelines who
don't need a serializer because their sax events are aggregated

Now, Vadim proposed the notion of having serializers that write on
output streams which are not connected to the requesting agent.

Something like this

  request -> g -> t* -> MX -> t* -> s -> response

this reminded me a lot of transistor 'drains', the place where the
electrons are consumed.

So, ideally, we could have 

 - a multiplexer/expander/exploder/dispatcher (which is the symmetrical
of the aggregator, but performs as a transformer)

 - one or more 'drains', which are generator-less semi-pipelines where
the draining output stream is explicitly written.

So we could have something like this:

 <match pattern="...">
  <generate .../>
  <transform ../> 
   <drain element="...." namespace="...." dest="drain://database"/>
   <drain element="...." namespace="...." dest="drain://email"/>
   <drain element="...." namespace="...." dest="drain://sms-gateway"/>
  <serialize .../>

where before we had something like this

  <map:drain name="database">
   <transform .../>
   <serialize .. dest="..."/>

note the 'dest' attribute of serializers!

we could also change the definition of 'internal pipelines' using 

  <map:source name="newsfeed">
   <generate .../>
   <transform .../>

and then have 

   <part src="source://newsfeed"/>

So, at the end we get:

 1) pipeline: g -> t* -> s
 2) source: g -> t*
 3) drain: t* -> s
 4) aggregator with parts
 5) router with drains (bah, don't really like the name router, but I
can't think of anything better)


Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche

To unsubscribe, e-mail:
For additional commands, email:

View raw message