Kamaelia docs : Kamaelia.Chassis.Prefab

Pre-fabrication function chassis

This is a collection of functions that link up components standardised ways.

They take a collection of components as arguments, and then wire them up in a particular fashion. These components are children inside the prefab.


Automated "what arguments should I use for my next reusable component?"

Take a Carousel that makes components on request from a set of arguments. Take a Chooser that responds to request for the 'next' set of arguments.

This pre-fab is a component that wires them together. When the Carousel requests the arguments for the next component, the Chooser can respond with them.

For example, you could wire up a playlist to something reusable that reads files at a given rate. Alternatively, it could be a list of videos or pictures passed to a reusable media viewer. It could even be a list of shell commands passed to a reusable shell/system caller.

Example Usage

Reading from a playlist of files:

def makeFileReader(filename):
    return ReadFileAdapter(filename = filename, ...other args... )

reusableFileReader = Carousel componentFactory = makeFileReader)
playlist = Chooser(["file1","file2" ... ])

playlistreader = JoinChooserToCarousel(playlist, reusableFileReader)

More detail

Any component can be used that has the expected inboxes and outboxes, and which behaves in a relevant manner.

Chooser must have inboxes "inbox" and "control" and outboxes "outbox" and "signal".

Carousel must have inboxes "inbox", "control" and "next" and outboxes "outbox", "signal" and "requestNext".

The Chooser and Carousel are encapsulated within this prefab component as children.

"inbox", "outbox" and "signal" of the Carousel are "inbox", "outbox" and "signal" of this prefab.

Messages sent to this prefab's "control" inbox go to the Chooser, which should then pass it onto the Carousel, allowing shutdown.

To do

This prefab needs a better name - it currently describes its design, not what its for.


prefab: JoinChooserToCarousel

JoinChooserToCarousel(chooser, carousel) -> component containing both wired up

Wires up a Chooser and a Carousel, so when the carousel requests the next item, the Chooser supplies it.

Keyword arguments:

  • chooser -- A Chooser component, or one with similar interfaces
  • carousel -- A Carousel component, or one with similar interfaces


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)