Back to index

rabbitmq-server  2.8.4
Public Member Functions | Public Attributes
base.WaitableListener Class Reference

List of all members.

Public Member Functions

def __init__
def on_receipt
def on_error
def on_message
def reset
def await
def print_state

Public Attributes

 debug
 messages
 errors
 receipts
 latch

Detailed Description

Definition at line 67 of file base.py.


Constructor & Destructor Documentation

Definition at line 69 of file base.py.

00069 
00070     def __init__(self):
00071         self.debug = False
00072         if self.debug:
00073             print '(listener) init'
00074         self.messages = []
00075         self.errors = []
00076         self.receipts = []
00077         self.latch = Latch(1)


Member Function Documentation

def base.WaitableListener.await (   self,
  timeout = 10 
)

Definition at line 106 of file base.py.

00106 
00107     def await(self, timeout=10):
00108         return self.latch.await(timeout)

def base.WaitableListener.on_error (   self,
  headers,
  message 
)

Definition at line 84 of file base.py.

00084 
00085     def on_error(self, headers, message):
00086         if self.debug:
00087             print '(on_error) message:', message, 'headers:', headers
00088         self.errors.append({'message' : message, 'headers' : headers})
00089         self.latch.countdown()

def base.WaitableListener.on_message (   self,
  headers,
  message 
)

Definition at line 90 of file base.py.

00090 
00091     def on_message(self, headers, message):
00092         if self.debug:
00093             print '(on_message) message:', message, 'headers:', headers
00094         self.messages.append({'message' : message, 'headers' : headers})
00095         self.latch.countdown()

def base.WaitableListener.on_receipt (   self,
  headers,
  message 
)

Definition at line 78 of file base.py.

00078 
00079     def on_receipt(self, headers, message):
00080         if self.debug:
00081             print '(on_receipt) message:', message, 'headers:', headers
00082         self.receipts.append({'message' : message, 'headers' : headers})
00083         self.latch.countdown()

def base.WaitableListener.print_state (   self,
  hdr = "" 
)

Definition at line 109 of file base.py.

00109 
00110     def print_state(self, hdr=""):
00111         print hdr,
00112         print '#messages:', len(self.messages),
00113         print '#errors:', len(self.errors),
00114         print '#receipts:', len(self.receipts),
00115         print 'Remaining count:', self.latch.get_count()

Here is the caller graph for this function:

def base.WaitableListener.reset (   self,
  count = 1 
)

Definition at line 96 of file base.py.

00096 
00097     def reset(self, count=1):
00098         if self.debug:
00099             self.print_state('(reset listener--old state)')
00100         self.messages = []
00101         self.errors = []
00102         self.receipts = []
00103         self.latch = Latch(count)
00104         if self.debug:
00105             self.print_state('(reset listener--new state)')

Here is the call graph for this function:


Member Data Documentation

Definition at line 70 of file base.py.

Definition at line 74 of file base.py.

Definition at line 76 of file base.py.

Definition at line 73 of file base.py.

Definition at line 75 of file base.py.


The documentation for this class was generated from the following file: