def _async_queue(): """Handles the blocking messaging for the worker queue.""" logger.info('Async queue thread is running.') queue_socket = context.socket(PULL) queue_socket.connect(settings.ZTASK_INTERNAL_QUEUE_URL) worker_socket = context.socket(PUSH) worker_socket.bind(settings.ZTASK_WORKER_URL) d = device(DeviceType.STREAMER, queue_socket, worker_socket)
def run(self): self.queue_socket.bind(settings.ZTASK_INTERNAL_QUEUE_URL) self.worker_socket.bind(settings.ZTASK_WORKER_URL) try: self.device = device(STREAMER, self.queue_socket, self.worker_socket) except ZMQError, e: if e.errno == 156384765: self.queue_socket.close() self.worker_socket.close() else: raise e