Package gofer :: Package messaging :: Module consumer :: Class Reader
[hide private]
[frames] | no frames]

Class Reader

source code

endpoint.Endpoint --+
                    |
                   Reader

An AMQP message reader.

Instance Methods [hide private]
 
__init__(self, destination, **options) source code
 
open(self)
Open the reader.
source code
 
close(self)
Close the reader.
source code
Envelope
next(self, timeout=90)
Get the next envelope from the queue.
source code
Message
read(self, timeout=90)
Get the next message from the queue.
source code
Envelope
search(self, sn, timeout=90)
Seach the reply queue for the envelope with the matching serial #.
source code
str
address(self)
Get the AMQP address for this endpoint.
source code
Message
__fetch(self, timeout)
Fetch the next message.
source code

Inherited from endpoint.Endpoint: __del__, __str__, ack, id, session

Inherited from endpoint.Endpoint (private): _lock, _unlock

Class Variables [hide private]

Inherited from endpoint.Endpoint: LOCALHOST, ssnpool

Instance Variables [hide private]
Destination __destination
The AMQP destination to read.
bool __opened
Indicates that open() has been called.
Receiver __receiver
An AMQP receiver to read.

Inherited from endpoint.Endpoint: url, uuid

Method Details [hide private]

__init__(self, destination, **options)
(Constructor)

source code 
Parameters:
  • destination (Destination) - The destination to consumer.
  • options (dict) - Options passed to Endpoint.
Overrides: endpoint.Endpoint.__init__

open(self)

source code 

Open the reader.

Overrides: endpoint.Endpoint.open

close(self)

source code 

Close the reader.

Overrides: endpoint.Endpoint.close

next(self, timeout=90)

source code 

Get the next envelope from the queue.

Parameters:
  • timeout (int) - The read timeout.
Returns: Envelope
The next envelope.

read(self, timeout=90)

source code 

Get the next message from the queue.

Parameters:
  • timeout (int) - The read timeout.
Returns: Message
The next message.

search(self, sn, timeout=90)

source code 

Seach the reply queue for the envelope with the matching serial #.

Parameters:
  • sn (str) - The expected serial number.
  • timeout (int) - The read timeout.
Returns: Envelope
The next envelope.

address(self)

source code 

Get the AMQP address for this endpoint.

Returns: str
The AMQP address.

__fetch(self, timeout)

source code 

Fetch the next message.

Parameters:
  • timeout (int) - The read timeout.
Returns: Message
The next message, or (None).