Package grassyknoll :: Package concurrent :: Module lib
[hide private]

Module lib

source code

Classes [hide private]
  _ThisThread
  TimeOut
TimeOut helps manage timeouts that are spread across several operations.
Functions [hide private]
Message.Message
talk(payload, to_box, timeout=None, reply_box=None)
send a single payload and receive a single reply.
source code

object

@raises Exception: if the reply's payload is a Fault.Fault, the underlying exception is raised.

@raises ConcurrentError: if the reply's payload is a ConcurrentError, it is raised.
chat(payload, to_box, timeout=None, reply_box=None)
like talk, but unpack the reply and return its payload
source code
Variables [hide private]
  thisThread = _ThisThread()
Function Details [hide private]

talk(payload, to_box, timeout=None, reply_box=None)

source code 
send a single payload and receive a single reply.
Parameters:
  • payload (object) - the payload to send
  • to_box (MailBox) - the box to send to
  • reply_box (MailBox) - the box replies should be sent to. If None, use thisThread.mailbox
  • timeout (float) - how long to in total to block before raising an exception, in seconds.
Returns: Message.Message
the reply

Warning: Any messages in reply_box which are not in response to the message sent by a call to this function will be discarded. This may include late replies (ie, after a timeout or other receiving error occurs).

chat(payload, to_box, timeout=None, reply_box=None)

source code 
like talk, but unpack the reply and return its payload
Returns:

object

@raises Exception: if the reply's payload is a Fault.Fault, the underlying exception is raised.

@raises ConcurrentError: if the reply's payload is a ConcurrentError, it is raised.
the reply's payload