Kamaelia docs : Axon.Box.postbox

For examples and more explanations, see the module level docs.


class postbox(object)

postbox(storage[,notify]) -> new postbox object.

Creates a postbox, using the specified storage as default storage. Storage should have the interface of list objects.

Also takes optional notify callback, that will be called whenever an item is taken out of a postbox further down the chain.

Methods defined here

__init__(self, storage[, notify])

x.__init__(...) initializes x; see x.__class__.__doc__ for signature.

__len__(self)

Returns number of items in the postbox

_addnotifys(self, newnotifys)

Updates the local storage's list of notification callbacks for when messages are taken out of inboxes. Then recurses this info to this postbox's target, so it can update too.

_removenotifys(self, oldnotifys)

Updates the local storage's list of notification callbacks for when messages are taken out of inboxes. Then recurses this info to this postbox's target, so it can update too.

_retarget(self[, newtarget])

retarget([newtarget]) aims requests at to this postbox at a different target.

If newtarget is unspecified or None, target is default local storage.

addsource(self, newsource)

addsource(newsource) registers newsource as a source and tells it to 'retarget' at this postbox.

Also finds out from the new source who wants to be notified when messages are taken out of postboxes, and updates records accordingly, and passes this info further down the chain of linkages.

Raises Axon.AxonExceptions.BoxAlreadyLinkedToDestination if the newsource is already targetted at a destination. This is because Axon does not support one-to-many arrangements.

getSize(self)

Gets current box size limit

getnotifys(self)

Returns list of all callbacks that should be made when messages are collected from a postbox using this one as a source.

The list returned is effectively all callbacks this postbox would have to make plus the callback for the owner of this box (if there is one)

isFull(self)

Returns True if the destination box is full (and has a size limit)

removesource(self, oldsource)

removesource(oldsource) deregisters oldsource as a source and tells it to 'retarget' at None (nothing).

Also finds out from the old source who was being notified when messages are taken out of postboxes, and updates records accordingly, and passes this info further down the chain of linkages.

setShowTransit(self[, showtransit][, tag])

Set showTransit to True to cause debugging output whenever a message is delivered to this postbox. The tag can be anything you want to identify this occurrence.

setSize(self, size)

Set box size limit (use None for no limit)

Behaviour is undefined (and not recommended!) if this call is made whilst there may be items in the postbox!

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, 01 Feb 2010 at 04:00:28 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)