openfaas / python-flask-template

HTTP and Flask-based OpenFaaS templates for Python 3
MIT License
85 stars 86 forks source link

added gevent #1

Closed viveksyngh closed 6 years ago

viveksyngh commented 6 years ago

Added gevent WSGI server

Signed-off-by: Vivek Singh vivekkmr45@yahoo.in

I tested it in local on Docker for Mac.

alexellis commented 6 years ago

LGTM let's ping @miserlou (Rich from Zappa) who suggested it and see if he has any other suggestions.

Would you be able to populate the pull-request with any of the normal details we include @viveksyngh ?

i.e.

How did the testing go for this?

viveksyngh commented 6 years ago

One thing I noticed, when I run the server like http_server.serve_forever() then for some request I am getting the response with request data for others response is returned but without request data. Without http_server.serve_forever() it working fine.

alexellis commented 6 years ago

It's a shame to have to add musl-dev and gcc.. do we need these after the initial build too? I take it that these are required for gevent.. or can we find it precompiled as a 'wheel'?

alexellis commented 6 years ago

@viveksyngh I merged this but it failed to work on my machine in a container 😞

When I try it locally on my mac having installed flask and gevent I get this error too:

Traceback (most recent call last):
  File "index.py", line 6, in <module>
    from gevent.pywsgi import WSGIServer
ImportError: No module named gevent.pywsgi

PTAL.. I'll revert the merge.

viveksyngh commented 6 years ago

That's weird, It was working on my system. I will check once again. I will also try to include a precompiled version of gevent.