April 2024 - This site, and Kamaelia are being updated. There is significant work needed, and PRs are welcome.

Axon.Postman.py

Version: Axon 1.0

TODO:Until deprecation, ensure test suite doc strings accurately detail behaviour. (deregister springs to mind as a poor example.)

A postman is a microprocess that knows about linkages, and components, and hence runs concurrently to your components. It can have a number of components & linkages registered with it.

Periodically it checks the sources of the linkages it knows about for messages. If it finds some messages it checks where to deliver them to by looking at the sink of the linkage. Assuming it finds a destination to deliver to, the postmans then delivers the messages to the inbox of the assigned destination component.

The Postman microprocess handles message delivery along linkages between inboxes and outboxes, usually contained in components. There is one postman per component.

Since a postman is a microprocess it runs in parallel with the components it's delivering messages between.

It is highly possible this could result in a race hazard if message queues can grow faster than the postman can deliver them. As a result the system provides Synchronised Boxes as well which have a maximum, enforced capacity which works to prevent this issue - at the expense of extra logic in the client

A Postman can have a debug name - this is to help differentiate between postmen who are delivering things versus those that aren't if problems arise.

Pydoc Style Documentation

class postman(Axon.Microprocess.microprocess)

__init__(self, debugname='')

Constructor. If a debug name is assigned this will be stored as a debugname attribute. Other attributes:

The super class's constructor is then called to make this a fully initialised microprocess.

__str__(self)

deregister(self, name=None, component=None)

deregisterlinkage(self, thecomponent=None, thelinkage=None)

domessagedelivery(self)

islinkageregistered(self, linkage)

main(self)

register(self, name, component)

registerlinkage(self, thelinkage)

showqueuelengths(self)

Testdoc Documentation

__init__

__str__

deregister

deregisterlinkage

domessagedelivery

register

registerlinkage

...

Michael, December 2004