Example #1
0
    def start(self):
        for i in range(self.num_worker_threads):
            thread_name = "thread-{}".format(i)
            kwargs = {"name": thread_name}

            t = Thread(target=self._worker, kwargs=kwargs)
            t.quit = False
            t.start()
            self.threads[thread_name] = t
Example #2
0
def test_null:
    mq = Queue()
    c = ControllerClient('localhost', 9999, mq)
    t = Thread(target=c.run, args=())
    #won't work, will block on receive_msg. Implement nonblocking sockets or timeouts.
    t.quit()