Home | Trees | Index | Help |
---|
Package spoon :: Package messaging :: Class Messaging |
|
object
--+
|
Messaging
SingletonMessaging
This is the main messaging class that implements the basic functionality for Spoon. Messaging implementations that need specific functionality (such as reliablility) will probably want to subclass from this.
There may be multiple instances of Messaging per python process, however there should only be one per network to which a node is a member. There may be a case where one would want a single Messaging instance shared between networks however, and as long as the node ids on the networks do not overlap, you shouldn't have any problems.
You cannot use the acceptMsg decorator with this, for that you have to use the SingletonMessaging class. To register handlers with instances of Messaging, you must use the registerHandler method on the Messaging instance.Method Summary | |
---|---|
__init__(self,
network)
| |
Calls the all handlers for the given message. | |
registerHandler(self,
msgtype,
handler)
| |
Sends a Messaging message (not just a NetMessage) to the destination node. | |
setNetwork(self,
network)
| |
unregisterHandler(self,
msgtype,
handler)
| |
Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__repr__() <==> repr(x) | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) |
Method Details |
---|
handleMessage(self, src, msg)Calls the all handlers for the given message.
|
send(self, dst, messageStr, obj)Sends a Messaging message (not just a NetMessage) to the destination node.
|
Home | Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Sun Nov 26 15:33:08 2006 | http://epydoc.sf.net |