spoon.messaging.receive

Package spoon :: Package messaging :: Class receive |
[show private | hide private]
[frames | no frames]

## Type receive

    object --+
             |
            receive

The receive decorator can be used to decorate functions and static methods (NOT methods of class instances) that should receive messages of a given type. In the case of static methods, be sure to put the staticmethod decorator first.

When a message of the given type is received, the function will be called with (srcNodeId, message type, attached object) as the arguments to it.

Method Summary
| ``__init__`(self, msgtype)`
| `__call__(self, handler)`
Inherited from object
| ``__delattr__`(...)` x.__delattr__('name') <==> del x.name
| ``__getattribute__`(...)` x.__getattribute__('name') <==> x.name
| ``__hash__`(x)` x.__hash__() <==> hash(x)
| ``__new__`(T, S, ...)` T.__new__(S, ...) -> a new object with type S, a subtype of T
| ``__reduce__`(...)` helper for pickle
| ``__reduce_ex__`(...)` helper for pickle
| ``__repr__`(x)` x.__repr__() <==> repr(x)
| ``__setattr__`(...)` x.__setattr__('name', value) <==> x.name = value
| ``__str__`(x)` x.__str__() <==> str(x)

Method Details

### __init__(self, msgtype) (Constructor) Parameters: `msgtype` - Indicates the message type that the function will receive. This can be a list of msgtypes as well as just a string. Overrides: `__builtin__.object.__init__`

Generated by Epydoc 2.1 on Sun Nov 26 15:33:08 2006 | http://epydoc.sf.net