Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
from tornado import gen, httpclient, ioloop, stack_context
io_loop = ioloop.IOLoop.instance()
client = httpclient.AsyncHTTPClient(io_loop=io_loop)
@gen.engine
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
@gen.engine
def fetch(callback):
#response = yield gen.Task(client.fetch, 'http://localhost:5000/')
yield gen.Task(io_loop.add_callback)
callback(None)
io_loop.add_callback(go_for_it)
io_loop.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.