August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)
For examples and more explanations, see the module level docs.
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.
x.__init__(...) initializes x; see x.__class__.__doc__ for signature.
Returns number of items in the postbox
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.
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([newtarget]) aims requests at to this postbox at a different target.
If newtarget is unspecified or None, target is default local storage.
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.
Gets current box size limit
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)
Returns True if the destination box is full (and has a size limit)
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.
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.
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!
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, 09 Dec 2009 at 04:00:25 UTC/GMT