def test_zadvanced_hunter_start():
    with Hunter(loop=loop, remote=ADDR) as h:
        h = Hunter(loop=loop, remote=ADDR)

        t = threading.Thread(target=h.start)

        t.start()

        assert t.is_alive()

        loop.stop()

        t.join()

        assert not t.is_alive()
Beispiel #2
0
 def _init_hunters(self, threads, token):
     self.logger.info('launching hunters...')
     for n in range(int(threads)):
         self.logger.warn(token)
         t = threading.Thread(
             target=Hunter(self.context, token=token).start)
         t.daemon = True
         t.start()
Beispiel #3
0
    def _init_hunters(self, threads, token):
        if int(threads) == 0:
            return

        logger.info('launching hunters...')
        self.hunter_sink_s = self.context.socket(zmq.ROUTER)
        self.hunter_sink_s.bind(HUNTER_SINK_ADDR)

        self.hunters_s = self.context.socket(zmq.PUSH)
        self.hunters_s.bind(HUNTER_ADDR)

        self.hunters = []
        for n in range(int(threads)):
            p = mp.Process(target=Hunter(token=token).start)
            p.start()
            self.hunters.append(p)
Beispiel #4
0
 def _init_hunters(self, threads, token):
     self.logger.info('launching hunters...')
     for n in range(int(threads)):
         p = mp.Process(target=Hunter(token=token).start)
         p.start()
Beispiel #5
0
def test_hunter():
    from cif.hunter import Hunter
    Hunter()
Beispiel #6
0
def test_hunter():
    with Hunter() as h:
        assert isinstance(h, Hunter)
Beispiel #7
0
def test_hunter():
    with Hunter(Context.instance()) as h:
        assert isinstance(h, Hunter)