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

Class Consumer

source code

endpoint.Endpoint --+
                    |
                   Consumer
Known Subclasses:

An AMQP (abstract) consumer. The received() method needs to be overridden.

Instance Methods [hide private]
 
__init__(self, destination, **options) source code
str
id(self)
Get the endpoint id
source code
str
address(self)
Get the AMQP address for this endpoint.
source code
 
start(self)
Start processing messages on the queue.
source code
 
stop(self)
Stop processing requests.
source code
 
close(self)
Close the consumer.
source code
 
join(self)
Join the worker thread.
source code
 
received(self, message)
Process received request.
source code
 
valid(self, envelope)
Check to see if the envelope is valid.
source code
 
dispatch(self, envelope)
Dispatch received request.
source code
 
__received(self, message)
Process received request.
source code

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

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

Class Methods [hide private]
str
subject(cls, message)
Extract the message subject.
source code
Class Variables [hide private]

Inherited from endpoint.Endpoint: LOCALHOST, ssnpool

Instance Variables [hide private]
Destination __destination
The AMQP destination to consume.
bool __started
Indicates that start() has been called.
ReceiverThread __thread
The receiver thread.

Inherited from endpoint.Endpoint: url, uuid

Method Details [hide private]

subject(cls, message)
Class Method

source code 

Extract the message subject.

Parameters:
  • message (qpid.messaging.Message) - The received message.
Returns: str
The message subject

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

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

id(self)

source code 

Get the endpoint id

Returns: str
The destination (simple) address.
Overrides: endpoint.Endpoint.id

address(self)

source code 

Get the AMQP address for this endpoint.

Returns: str
The AMQP address.

close(self)

source code 

Close the consumer. Stop the receiver thread.

Overrides: endpoint.Endpoint.close

received(self, message)

source code 

Process received request. Inject subject & destination.uuid.

Parameters:
  • message (qpid.messaging.Message) - The received message.

valid(self, envelope)

source code 

Check to see if the envelope is valid.

Parameters:
  • envelope (qpid.messaging.Message) - The received envelope.

dispatch(self, envelope)

source code 

Dispatch received request.

Parameters:
  • envelope (qpid.messaging.Message) - The received envelope.

__received(self, message)

source code 

Process received request. Inject subject & destination.uuid.

Parameters:
  • message (qpid.messaging.Message) - The received message.