Kamaelia docs : Kamaelia.Util.LossyConnector

Lossy connections between components

A component that passes on any data it receives, but will throw it away if the next component's inbox is unable to accept new items.

Example Usage

Using a lossy connector to drop excess data::

src = fastProducer().activate() lsy = LossyConnector().activate() dst = slowConsumer().activate()

src.link( (src,"outbox"), (lsy,"inbox") ) src.link( (lsy,"outbox"), (dst,"inbox"), pipewidth=1 )

The outbox of the lossy connector is joined to a linkage that can buffer a maximum of one item. Once full, the lossy connector causes items to be dropped.

How does it work?

This component receives data on its "inbox" inbox and immediately sends it on out of its "oubox" outbox.

If the act of sending the data causes a noSpaceInBox exception, then it is caught, and the data that it was trying to send is simply discarded.

I a producerFinished or shutdownMicroprocess message is received on the component's "control" inbox, then the message is forwarded on out of its "signal" outbox and the component then immediately terminates.


Kamaelia.Util.LossyConnector.LossyConnector

class LossyConnector(Axon.Component.component)

LossyConnector() -> new LossyConnector component

Component that forwards data from inbox to outbox, but discards data if destination is full.

Inboxes

  • control : Shutdown signalling
  • inbox : Data to be passed on

Outboxes

  • outbox : Data received on 'inbox' inbox
  • signal : Shutdown signalling

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.

mainBody(self)

Main loop body.

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, 05 Jun 2009 at 03:01:38 UTC/GMT


Kamaelia is an open source project originated from and guided by BBC Research. For more information browse the site or get in contact.

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. (the site is powered by a wiki engine)

(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.

This web site is powered by the same code created for the bicker manor project. For more details, contact Michael Sparks at BBC Research directly (cf contact)