Beispiel #1
0
 def run(self, handler):
     from gevent import pywsgi, local
     if not isinstance(threading.local(), local.local):
         msg = "Ombott requires gevent.monkey.patch_all() (before import)"
         raise RuntimeError(msg)
     if self.quiet:
         self.options['log'] = None
     address = (self.host, self.port)
     server = pywsgi.WSGIServer(address, handler, **self.options)
     server.serve_forever()
Beispiel #2
0
def run(no_sockets=False):
    # with WebSocketHandler debug doest work, maybe some solution from
    # http://flask.pocoo.org/snippets/34/
    if no_sockets:
        app.run('localhost',5000)
    else:
        from gevent import pywsgi
        from geventwebsocket.handler import WebSocketHandler
        server = pywsgi.WSGIServer(('localhost', 5000), app, handler_class=WebSocketHandler)
        server.serve_forever()
Beispiel #3
0
def run(no_sockets=False):
    # with WebSocketHandler debug doest work, maybe some solution from
    # http://flask.pocoo.org/snippets/34/
    if no_sockets:
        app.run('localhost', 5000)
    else:
        from gevent import pywsgi
        from geventwebsocket.handler import WebSocketHandler
        server = pywsgi.WSGIServer(('localhost', 5000),
                                   app,
                                   handler_class=WebSocketHandler)
        server.serve_forever()
Beispiel #4
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()
Beispiel #5
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()