Skip to content

Instantly share code, notes, and snippets.

@kausality
kausality / app.py
Created September 5, 2017 21:05 — forked from rickardb/app.py
Simple iostream example.
import logging
import socket
import tornado.ioloop
import tornado.iostream
import tornado.options
# Nothing listening here
host = "127.0.0.1"
port = 12345
@kausality
kausality / streaming.py
Created September 5, 2017 21:05 — 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