'Request shutdown.
:param bool finish_queue: Should all tasks be finished before ending thread.'

def shutdown(self, finish_queue=True):

    log.debug(u'task    queue    shutdown    requested')
    if finish_queue:
        self._shutdown_when_finished = True
        if self.run_queue.qsize():
            log.verbose((u'There    are    %s    tasks    to    execute.    Shutdown    will    commence    when    they    have    completed.' % self.run_queue.qsize()))
    else:
        self._shutdown_now = True
