| 2111 | class FapwsServer(ServerAdapter): |
| 2112 | """ Extremely fast webserver using libev. See http://www.fapws.org/ """ |
| 2113 | def run(self, handler): # pragma: no cover |
| 2114 | import fapws._evwsgi as evwsgi |
| 2115 | from fapws import base, config |
| 2116 | port = self.port |
| 2117 | if float(config.SERVER_IDENT[-2:]) > 0.4: |
| 2118 | # fapws3 silently changed its API in 0.5 |
| 2119 | port = str(port) |
| 2120 | evwsgi.start(self.host, port) |
| 2121 | # fapws3 never releases the GIL. Complain upstream. I tried. No luck. |
| 2122 | if 'BOTTLE_CHILD' in os.environ and not self.quiet: |
| 2123 | print "WARNING: Auto-reloading does not work with Fapws3." |
| 2124 | print " (Fapws3 breaks python thread support)" |
| 2125 | evwsgi.set_base_module(base) |
| 2126 | def app(environ, start_response): |
| 2127 | environ['wsgi.multiprocess'] = False |
| 2128 | return handler(environ, start_response) |
| 2129 | evwsgi.wsgi_cb(('', app)) |
| 2130 | evwsgi.run() |
| 2131 | |
| 2132 | |
| 2133 | class TornadoServer(ServerAdapter): |