def METHOD_NAME(self):
    if self.running:
        log.debug('shutting down {!r}'.format(self))
        self._empty_queues()
        # Send shutdown signal
        for _i in range(self.n_workers):
            self.task_queue.put(task_shutdown_sentinel, block=False)
        for worker in self.workers:
            worker.join(self.shutdown_timeout)
            if worker.is_alive():
                log.debug('sending SIGINT to worker process {:d}'.format(worker.pid))
                os.kill(worker.pid, signal.SIGINT)
                worker.join(self.shutdown_timeout)
                if worker.is_alive():
                    log.warning('sending SIGKILL to worker process {:d}'.format(worker.pid))
                    os.kill(worker.pid, signal.SIGKILL)
                    worker.join()
                log.debug('worker process {:d} terminated with code {:d}'.format(worker.pid, worker.exitcode))
            else:
                log.debug('worker process {:d} terminated gracefully with code {:d}'.format(worker.pid, worker.exitcode))
        self._empty_queues()
        self.result_queue.put(result_shutdown_sentinel)
        self.running = False