Skip to content

Instantly share code, notes, and snippets.

View bcperea's full-sized avatar

Brian Perea bcperea

View GitHub Profile
@bcperea
bcperea / streaming.py
Created July 31, 2018 19:45 — forked from bdarnell/streaming.py
Demo of streaming requests with Tornado
"""Demo of streaming requests with Tornado.
This script features a client using AsyncHTTPClient's body_producer
feature to slowly produce a large request body, and two server
handlers to receive this body (one is a proxy that forwards to the
other, also using body_producer).
It also demonstrates flow control: if --client_delay is smaller than
--server_delay, the client will eventually be suspended to allow the
server to catch up. You can see this in the logs, as the "client