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()
def start_update(self): run_as_thread(self._update_loop)
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 = {}
def _start_import(self): self._importer = self._get_importer() run_as_thread(self._importer.do_import, self._csv_file.get_path(), name="import2pinry")
def add_task(self, task_iter, background=False): if background: run_as_thread(self._add_task, task_iter) else: self._add_task(task_iter)