Kamaelia docs : Kamaelia.Util.TwoWaySplitter

Send stuff to two places

Splits a data source sending it to two destinations. Forwards both things sent to its "inbox" inbox and "control" inboxes, so shutdown messages propogate through this splitter. Fully supports delivery to size limited inboxes.

Example Usage

Send from a data source to two destinations. Do this for both the inbox->outbox path and the signal->control paths, so both destinations receive shutdown messages when the data source finishes:

Graphline( SOURCE = MyDataSource(),
           SPLIT  = TwoWaySplitter(),
           DEST1  = MyDataSink1(),
           DEST2  = MyDataSink2(),
           linkages = {
               ("SOURCE", "outbox") : ("SPLIT", "inbox"),
               ("SOURCE", "signal") : ("SPLIT", "control")

               ("SPLIT", "outbox") : ("DEST1", "inbox"),
               ("SPLIT", "signal") : ("DEST1", "control"),

               ("SPLIT", "outbox2") : ("DEST1", "inbox"),
               ("SPLIT", "signal2") : ("DEST1", "control"),
           }
         ).run()

Behaviour

Send a message to the "inbox" inbox of this component and it will be sent on out of the "outbox" and "outbox2" outboxes.

This component supports sending to a size limited inbox. If the size limited inbox is full, this component will pause until it is able to send out the data.

Send a message to the "control" inbox of this component and it will be sent on out of the "signal" and "signal2" outboxes. If the message is a shutdownMicroprocess message then this component will also terminate immediately. If it is a producerFinished message then this component will finish sending any messages still waiting at its "inbox" inbox, then immediately terminate.


Kamaelia.Util.TwoWaySplitter.TwoWaySplitter

class TwoWaySplitter(Axon.Component.component)

TwoWaySplitter() -> new TwoWaySplitter component

Anything sent to the "inbox" or "control" inboxes is sent on out of the "outbox" and "outbox2" or "signal" and "signal2" outboxes respectively.

Inboxes

  • control : Shutdown signalling (also sent to the 'signal' and 'signal2' outboxes
  • inbox : Message to be sent to the 'outbox' and 'outbox2' outboxes

Outboxes

  • outbox2 : Messages sent to the 'inbox' inbox
  • outbox : Messages sent to the 'inbox' inbox
  • signal : Messages sent to the 'control' inbox
  • signal2 : Messages sent to the 'control' inbox

Feedback

Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!

Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.

-- Automatic documentation generator, 19 Oct 2008 at 14:29:09 UTC/GMT

This is a page from the Kamaelia website. You can find the original here: