Exemple #1
0
def start_monitorq():
    from zmq.devices.monitoredqueue import monitored_queue
    ctx = zmq.Context(1)
    s_in = ctx.socket(zmq.ROUTER)
    s_in.bind('tcp://*:9001')
    s_out = ctx.socket(zmq.DEALER)
    s_out.bind('tcp://*:9002')
    s_mon = ctx.socket(zmq.PUB)
    s_mon.bind('tcp://*:9003')
    try:
        print 'start monitored queue...'
        monitored_queue(s_in, s_out, s_mon)
    except KeyboardInterrupt:
        pass
    finally:
        s_in.close()
        s_out.close()
        s_mon.close()
        ctx.term()
 def run(self):
     ins,outs,mons = self._setup_sockets()
     rc = monitored_queue(ins, outs, mons, 
         self._in_prefix, self._out_prefix)
     self.done = True
     return rc
Exemple #3
0
 def run_device(self):
     ins, outs, mons = self._setup_sockets()
     monitored_queue(ins, outs, mons, self._in_prefix, self._out_prefix)
 def run_device(self):
     ins,outs,mons = self._setup_sockets()
     monitored_queue(ins, outs, mons, self._in_prefix, self._out_prefix)