'Graceful shutdown of the worker server.'

def stop(self, in_sighandler=False, exitcode=None):

    if (exitcode is not None):
        self.exitcode = exitcode
    if (self.blueprint.state == RUN):
        self.signal_consumer_close()
        if ((not in_sighandler) or self.pool.signal_safe):
            self._shutdown(warm=True)
    self._send_worker_shutdown()
