Skip to content

Instantly share code, notes, and snippets.

@jacobian
Created April 18, 2011 20:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobian/926162 to your computer and use it in GitHub Desktop.
Save jacobian/926162 to your computer and use it in GitHub Desktop.
See if your WSGI server will chunk for you.
#
# Run this under your WSGI server, and then try
#
# curl -N -i <server>
#
# If you're chunked, you should see the pause between "hello" and "world".
import time
def application(environ, start_response):
"""Simplest possible application object"""
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
def resp():
yield "hello "
time.sleep(1)
yield "world!\n"
return resp()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment