def start(self): setproctitle("gevent-spawn.py: worker") super(Worker, self).start() core.signal(signal_stop, self._cb_stop_worker) env = self.base_env.copy() env["SERVER_NAME"] = socket.getfqdn(self.server_host) env["SERVER_PORT"] = str(self.server_port) self.base_env = env self.log_server("Worker serving on %s:%d" % (self.server_host, self.server_port)) return self.socket
def signal(signalnum, handler, *args, **kwargs): return core.signal( signalnum, lambda: spawn_raw(_wrap_signal_handler, handler, args, kwargs))
def start(self): """Set up signal actions.""" setproctitle("gevent-spawn.py: master") core.signal(signal.SIGCHLD, self._cb_sigchld) core.signal(signal.SIGHUP, self._cb_sighup) core.signal(signal.SIGTERM, self._cb_sigterm)
def signal(signalnum, handler, *args, **kwargs): return core.signal(signalnum, lambda: spawn_raw(_wrap_signal_handler, handler, args, kwargs))