Package pulp :: Package messaging :: 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, timeout) source code
object
send(self, destination, request, **any)
Send the request then read the reply.
source code
 
__getstarted(self, sn) source code
Envelope
__getreply(self, sn)
Get the reply matched by serial number.
source code
    Inherited from RequestMethod
 
broadcast(self, addresses, request, **any)
Broadcast the request.
source code
 
close(self)
Close and release all resources.
source code
Instance Variables [hide private]
pulp.messaging.consumer.Reader reader
A queue reader used to read the reply.
    Inherited from RequestMethod
pulp.messaging.producer.Producer producer
A queue producer.
Method Details [hide private]

__init__(self, producer, timeout)
(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

__getreply(self, sn)

source code 

Get the reply matched by serial number.

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