Package gofer :: Package rmi :: Module policy :: Class Synchronous
[hide private]
[frames] | no frames]

Class Synchronous

source code

RequestMethod --+
                |
               Synchronous

The synchronous request method. This method blocks until a reply is received.

Instance Methods [hide private]
 
__init__(self, producer, options) source code
object
send(self, destination, request, **any)
Send the request then read the reply.
source code
Envelope
__getstarted(self, sn, reader)
Get the STARTED reply matched by serial number.
source code
Envelope
__getreply(self, sn, reader)
Get the reply matched by serial number.
source code
Envelope
__onreply(self, envelope)
Handle the reply.
source code
 
__onprogress(self, envelope)
Handle the progress report.
source code

Inherited from RequestMethod: broadcast

Class Variables [hide private]
  TIMEOUT = (10, 90)
Instance Variables [hide private]
gofer.messaging.consumer.Reader reader
A queue reader used to read the reply.

Inherited from RequestMethod: producer

Method Details [hide private]

__init__(self, producer, options)
(Constructor)

source code 
Parameters:
Overrides: RequestMethod.__init__

send(self, destination, request, **any)

source code 

Send the request then read the reply.

Parameters:
  • destination (str) - The destination queue address.
  • request (object) - A request to send.
  • any - Any (extra) data.
Returns: object
The result of the request.
Raises:
  • Exception - returned by the peer.
Overrides: RequestMethod.send

__getstarted(self, sn, reader)

source code 

Get the STARTED reply matched by serial number.

Parameters:
  • sn (str) - The request serial number.
  • reader (Reader) - A reader.
Returns: Envelope
The matched reply envelope.

__getreply(self, sn, reader)

source code 

Get the reply matched by serial number.

Parameters:
  • sn (str) - The request serial number.
  • reader (Reader) - A reader.
Returns: Envelope
The matched reply envelope.

__onreply(self, envelope)

source code 

Handle the reply.

Parameters:
  • envelope (Envelope) - The reply envelope.
Returns: Envelope
The matched reply envelope.

__onprogress(self, envelope)

source code 

Handle the progress report.

Parameters:
  • envelope (Envelope) - The status envelope.