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

Class receive

source code

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.

Instance Methods [hide private]
  __init__(self, msgtype)
  __call__(self, handler)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, msgtype)
(Constructor)

source code 
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: object.__init__

__call__(self, handler)
(Call operator)

source code 
None