def METHOD_NAME(self):
    while not self.task_queue.empty():
        try:
            self.task_queue.get(block=False)
        except multiprocessing.queues.Empty:
            break
    while not self.result_queue.empty():
        try:
            self.result_queue.get(block=False)
        except multiprocessing.queues.Empty:
            break