'Remove all queued work from in_queue and poison the loop so the consumer
exits. Should be very fast and called only if we don\'t care about the
queued work anymore (ie. user clicked stop in the UI).'

def terminate(self):

    while (not self.in_queue.empty()):
        self.in_queue.get()
        self.in_queue.task_done()
    self.join()
