Package grassyknoll :: Package concurrent :: Module MailBox :: Class MailBox
[hide private]

Class MailBox

source code


abstract base class representing a destination for Message.Messages

Timeouts are interpreted as follows:

Instance Methods [hide private]
 
__init__(self, name=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__repr__(self)
repr(x)
source code
 
send(self, mesg, timeout=None)
send message to this box
source code
 
recv(self, timeout=None)
receive a message from this box
source code
 
sendNow(self, mesg)
send message non-blocking (ie, timeout=None).
source code
 
recvNow(self)
receive message non-blocking (ie, timeout=None).
source code
 
__len__(self) source code

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

Instance Variables [hide private]
string name
a human-readable name for this box.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name=None)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

send(self, mesg, timeout=None)

source code 
send message to this box
Parameters:
  • mesg (Message.Message) - the message to send
  • timeout (float) - how long to block sending before raising an exception, in seconds. See class docstring.
Raises:

recv(self, timeout=None)

source code 
receive a message from this box
Parameters:
  • timeout (float) - how long to block receiving before raising an exception, in seconds. See class docstring.
Returns:
a message that was sent to this box
Raises:
  • RecieveError - on any problem recieving a message
  • BoxEmptyError - when the box has no new messages.

sendNow(self, mesg)

source code 
send message non-blocking (ie, timeout=None). See send

recvNow(self)

source code 
receive message non-blocking (ie, timeout=None). See send

Instance Variable Details [hide private]

name

a human-readable name for this box. May be None.
Type:
string