def mainloop_send(self): try: while True: job = self._send_queue.get() self._sock.send(dumpb(job), copy=False) except zmq.ContextTerminated: pass