Пример #1
0
 def run(self, handler):
     from gevent import wsgi, pywsgi, local
     if not isinstance(threading.local(), local.local):
         msg = "Bottle requires gevent.monkey.patch_all() (before import)"
         raise RuntimeError(msg)
     if not self.options.pop('fast', None): wsgi = pywsgi
     self.options['log'] = None if self.quiet else 'default'
     address = (self.host, self.port)
     server = wsgi.WSGIServer(address, handler, **self.options)
     if 'BOTTLE_CHILD' in os.environ:
         import signal
         signal.signal(signal.SIGINT, lambda s, f: server.stop())
     server.serve_forever()
Пример #2
0
 def run(self, handler):
     from gevent import pywsgi, local
     if not isinstance(threading.local(), local.local):
         msg = "Bottle requires gevent.monkey.patch_all() (before import)"
         raise RuntimeError(msg)
     if self.options.pop('fast', None):
         depr(
             'The "fast" option has been deprecated and removed by Gevent.')
     if self.quiet:
         self.options['log'] = None
     address = (self.host, self.port)
     server = pywsgi.WSGIServer(address, handler, **self.options)
     if 'BOTTLE_CHILD' in os.environ:
         import signal
         signal.signal(signal.SIGINT, lambda s, f: server.stop())
     server.serve_forever()
Пример #3
0
 def handle_exit(self, sig, frame):
     server.stop()
     sys.exit(0)
Пример #4
0
 def handle_quit(self, sig, frame):
     server.stop(int(self.timeout))
Пример #5
0
    def watchdog(self):
        self.notify()

        if self.ppid != os.getppid():
            self.log.info("Parent changed, shutting down: %s" % self)
            server.stop(int(self.timeout))
Пример #6
0
 def handle_exit(self, sig, frame):
     server.stop()
     sys.exit(0)
Пример #7
0
 def handle_quit(self, sig, frame):
     server.stop(int(self.timeout))
Пример #8
0
    def watchdog(self):
        self.notify()

        if self.ppid != os.getppid():
            self.log.info("Parent changed, shutting down: %s" % self)
            server.stop(int(self.timeout))
Пример #9
0
 def handle_quit(self, sig, frame):
     server.stop()
Пример #10
0
 def handle_quit(self, sig, frame):
     server.stop()