Skip to content

Instantly share code, notes, and snippets.

@n1try n1try/
Last active Nov 8, 2017

What would you like to do?
Sample WSGI web server with Flask
# gunicorn --bind --workers 4 wsgi:app
# gunicorn --bind --workers 1 --threads 12 wsgi:app
import time
from flask import Flask
app = Flask(__name__)
# Requests from one client are not blocked by long-lasting requests from another client, as long as there are workers available
def sleep():
return 'I slept for 10 seconds...'
def hello():
return 'Hello Flask!'
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.