| 3350 | """ Extremely fast webserver using libev. See https://github.com/william-os4y/fapws3 """ |
| 3351 | |
| 3352 | def run(self, handler): # pragma: no cover |
| 3353 | depr(0, 13, "fapws3 is not maintained and support will be dropped.") |
| 3354 | import fapws._evwsgi as evwsgi |
| 3355 | from fapws import base, config |
| 3356 | port = self.port |
| 3357 | if float(config.SERVER_IDENT[-2:]) > 0.4: |
| 3358 | # fapws3 silently changed its API in 0.5 |
| 3359 | port = str(port) |
| 3360 | evwsgi.start(self.host, port) |
| 3361 | # fapws3 never releases the GIL. Complain upstream. I tried. No luck. |
| 3362 | if 'BOTTLE_CHILD' in os.environ and not self.quiet: |
| 3363 | _stderr("WARNING: Auto-reloading does not work with Fapws3.") |
| 3364 | _stderr(" (Fapws3 breaks python thread support)") |
| 3365 | evwsgi.set_base_module(base) |
| 3366 | |
| 3367 | def app(environ, start_response): |
| 3368 | environ['wsgi.multiprocess'] = False |
| 3369 | return handler(environ, start_response) |
| 3370 | |
| 3371 | evwsgi.wsgi_cb(('', app)) |
| 3372 | evwsgi.run() |
| 3373 | |
| 3374 | |
| 3375 | class TornadoServer(ServerAdapter): |