コード例 #1
0
ファイル: testutils.py プロジェクト: Naishy/stomp.py
 def on_error(self, headers, message):
     StatsListener.on_error(self, headers, message)
     self.error_list.append((headers, message))
     self.error_condition.acquire()
     self.error_received = True
     self.error_condition.notify()
     self.error_condition.release()
コード例 #2
0
 def on_message(self, headers, message):
     StatsListener.on_message(self, headers, message)
     self.message_list.append((headers, message))
     self.message_condition.acquire()
     self.message_received = True
     self.message_condition.notify()
     self.message_condition.release()
コード例 #3
0
ファイル: testutils.py プロジェクト: Naishy/stomp.py
 def __init__(self, receipt=None):
     StatsListener.__init__(self)
     WaitingListener.__init__(self, receipt)
     self.message_list = []
     self.message_condition = threading.Condition()
     self.message_received = False
     self.error_list = []
     self.error_condition = threading.Condition()
     self.error_received = False
コード例 #4
0
 def stats(self, args):
     '''
     Usage:
         stats [on|off]
         
     Description:
         Record statistics on messages sent, received, errors, etc. If no argument (on|off) is specified,
         dump the current statistics.
     '''
     if len(args) < 2:
         stats = self.c.get_listener('stats')
         if stats:
             print stats
         else:
             print 'No stats available'
     elif args[1] == 'on':
         self.c.set_listener('stats', StatsListener())
     elif args[1] == 'off':
         self.c.remove_listener('stats')
     else:
         print 'expecting: stats [on|off]'
コード例 #5
0
 def __init__(self, receipt=None):
     StatsListener.__init__(self)
     WaitingListener.__init__(self, receipt)
     self.message_list = []
     self.message_condition = threading.Condition()
     self.message_received = False
コード例 #6
0
ファイル: QueueReceiver.py プロジェクト: avidya/trident
 def __init__(self, receipt, subscribe_id, persister):
     StatsListener.__init__(self)
     WaitingListener.__init__(self, "%s%s" % (receipt, subscribe_id))
     self.dbPersisted = persister
     self.id = subscribe_id