def METHOD_NAME(self):
    def request_force_stop():
        self.log.warning("Cold shut down.")
        self.gevent_pool.kill()
        raise SystemExit()
    def request_stop():
        if not self._stop_requested:
            gevent.signal_handler(signal.SIGINT, request_force_stop)
            gevent.signal_handler(signal.SIGTERM, request_force_stop)
            self.log.warning("Warm shut down requested.")
            self.log.warning(
                "Stopping after all greenlets are finished. "
                "Press Ctrl+C again for a cold shutdown."
            )
            self._stop_requested = True
            self.gevent_pool.join()
            if self.gevent_worker is not None:
                self.gevent_worker.kill(StopRequested)
    gevent.signal_handler(signal.SIGINT, request_stop)
    gevent.signal_handler(signal.SIGTERM, request_stop)