Esempio n. 1
0
 def start(self, listener, watchdog=None):
     """
     Start processing messages on the queue and
     forward to the listener.
     @param listener: A reply listener.
     @type listener: L{Listener}
     @param watchdog: An (optional) watchdog.
     @type watchdog: L{WatchDog}
     """
     self.listener = listener
     self.watchdog = watchdog or LazyDog()
     self.blacklist = set()
     Consumer.start(self)
Esempio n. 2
0
    def test_init(self):
        url = 'test-url'
        node = Node('test-queue')

        # test
        consumer = Consumer(node, url)

        # validation
        self.assertEqual(consumer.node, node)
        self.assertEqual(consumer.url, url)
Esempio n. 3
0
File: base.py Progetto: jortel/gofer
 def __init__(self, url):
     queue = Queue(address.queue)
     Consumer.__init__(self, queue, url=url)
     self.received = 0
Esempio n. 4
0
 def __init__(self, url, uuid, port, host=HOST):
     Consumer.__init__(self, toq(uuid), url=url)
     self.uuid = uuid
     self.port = port
     self.host = host
Esempio n. 5
0
 def __init__(self, url):
     topic = Topic('heartbeat')
     Consumer.__init__(self, topic, url=url)
Esempio n. 6
0
 def __init__(self, url):
     queue = Queue(address.queue)
     Consumer.__init__(self, queue, url=url)
     self.received = 0
Esempio n. 7
0
 def __init__(self, url):
     topic = Topic('heartbeat')
     Consumer.__init__(self, topic, url=url)