def capture(self, limit=None): """Open up a consumer capturing events. This has to be running in the main process, and it will never stop unless forced""" consumer = EventConsumer(self.connection) consumer.register_callback(self._receive) it = consumer.iterconsume(limit=limit) while True: it.next()
def capture(self, limit=None): """Open up a consumer capturing events. This has to run in the main process, and it will never stop unless forced via :exc:`KeyboardInterrupt` or :exc:`SystemExit`. """ consumer = EventConsumer(self.connection) consumer.register_callback(self._receive) it = consumer.iterconsume(limit=limit) while True: it.next()
def consumer(self): consumer = EventConsumer(self.connection) consumer.register_callback(self._receive) return consumer