Skip to content

Instantly share code, notes, and snippets.

@bluepnume
Created May 11, 2015 04:09
Show Gist options
  • Select an option

  • Save bluepnume/c05ca077854218bf10fb to your computer and use it in GitHub Desktop.

Select an option

Save bluepnume/c05ca077854218bf10fb to your computer and use it in GitHub Desktop.
from gevent import monkey, sleep
from gevent.pywsgi import WSGIServer
from flask import Flask
monkey.patch_all()
app = Flask(__name__)
@app.route("/")
def hello():
print 'request'
sleep(10)
return 'response'
if __name__ == "__main__":
http_server = WSGIServer(('',5000), app)
http_server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment