Kamaelia

Nuts & Bolts | Components | Tools | Cookbook | Systems
wiki:( guest720847, 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.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.

JoinChooserToCarousel

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)
playlistreader.activate()

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.


Kamaelia.Chassis.Prefab.JoinChooserToCarousel

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

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.