Esempio n. 1
0
    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
Esempio n. 2
0
def signal(signalnum, handler, *args, **kwargs):
    return core.signal(
        signalnum,
        lambda: spawn_raw(_wrap_signal_handler, handler, args, kwargs))
Esempio n. 3
0
 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)
Esempio n. 4
0
File: hub.py Progetto: SMFOSS/gevent
def signal(signalnum, handler, *args, **kwargs):
    return core.signal(signalnum, lambda: spawn_raw(_wrap_signal_handler, handler, args, kwargs))