| 3748 | """ Extremely fast webserver using libev. See https://github.com/william-os4y/fapws3 """ |
| 3749 | |
| 3750 | def run(self, handler): # pragma: no cover |
| 3751 | depr(0, 13, "fapws3 is not maintained and support will be dropped.") |
| 3752 | import fapws._evwsgi as evwsgi |
| 3753 | from fapws import base, config |
| 3754 | port = self.port |
| 3755 | if float(config.SERVER_IDENT[-2:]) > 0.4: |
| 3756 | # fapws3 silently changed its API in 0.5 |
| 3757 | port = str(port) |
| 3758 | evwsgi.start(self.host, port) |
| 3759 | # fapws3 never releases the GIL. Complain upstream. I tried. No luck. |
| 3760 | if 'BOTTLE_CHILD' in os.environ and not self.quiet: |
| 3761 | _stderr("WARNING: Auto-reloading does not work with Fapws3.") |
| 3762 | _stderr(" (Fapws3 breaks python thread support)") |
| 3763 | evwsgi.set_base_module(base) |
| 3764 | |
| 3765 | def app(environ, start_response): |
| 3766 | environ['wsgi.multiprocess'] = False |
| 3767 | return handler(environ, start_response) |
| 3768 | |
| 3769 | evwsgi.wsgi_cb(('', app)) |
| 3770 | evwsgi.run() |
| 3771 | |
| 3772 | |
| 3773 | class TornadoServer(ServerAdapter): |