Kamaelia

Nuts & Bolts | Components | Tools | Cookbook | Systems
wiki:( guest720873, Dev Console, Index, Recent, Edit )


Home, News
Dev Console

How, Why
Project Blog
Summer of Code

Documentation
Download
SVN (web)
Sourceforge page

Project Admin
License

Contact Us

  Page Tags

No tags are defined for this page yet - how would you classify/think of this page? Add your notes below!

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

Methods defined here

Warning!

You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.

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, 20 Jul 2008 at 03:02:36 UTC/GMT


Your tags for this page: If you had set UserPreferences (name & email) and validated them (simple single click in your email), you would be able to define personal tags

Versions: current , 1


(C) 2005 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved,
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC.