Search code examples
cherrypygevent

running cherrypy application on gevent wsgi server


I have an existing cherrypy application but I want to know is if it's at all possible to run it on the gevent wsgi server. I imagine I can but I don't have access to a linux server to test out gevent and haven't been able to get it to run on my mac.

I'm under the impression this is possible since each side follows wsgi spec.

Has anyone tried this?

I guess an example would look like the following:

import cherrypy 
from gevent import wsgi

class Root(object):
     def index(self):
        return "hi!"
     index.exposed = True

app = cherrypy.tree.mount(Root(), '/')
wsgi.WSGIServer(('', 8088), app).serve_forever()

Solution

  • That example works fine. I'm sure #gevent on freenode would help you with any installation issues.