Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
from tornado import gen, httpclient, ioloop, stack_context
io_loop = ioloop.IOLoop.instance()
client = httpclient.AsyncHTTPClient(io_loop=io_loop)
def go_for_it():
c = 0
while True:
r = yield gen.Task(fetch)
c += 1
if c == 1000:
import pdb; pdb.set_trace()
if c % 100 == 0:
print '%s...' % c
def fetch(callback):
#response = yield gen.Task(client.fetch, 'http://localhost:5000/')
yield gen.Task(io_loop.add_callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment