Example #1
0
    def join(self, background=False):
        def run():
            self._download_queue.join()
            while not self._all_task_add:
                time.sleep(0.2)
                self._download_queue.join()
            self.done = True

        if background:
            run_as_thread(run)
        else:
            run()
Example #2
0
 def start_update(self):
     run_as_thread(self._update_loop)
Example #3
0
 def __init__(self):
     self.recv_queue = Queue()
     self.send_queue = Queue()
     self._t = run_as_thread(self.start_recv)
     self._lock_registry = {}
     self._ret_registry = {}
Example #4
0
 def _start_import(self):
     self._importer = self._get_importer()
     run_as_thread(self._importer.do_import,
                   self._csv_file.get_path(),
                   name="import2pinry")
Example #5
0
 def add_task(self, task_iter, background=False):
     if background:
         run_as_thread(self._add_task, task_iter)
     else:
         self._add_task(task_iter)