Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tornado - Non-Blocking Httpclient
print "\nNon-Blocking AsyncHTTPClient"
import tornado.ioloop
def async_call(response):
if response.error:
response.rethrow()
print "AsyncHTTPClient Response"
ioloop.IOLoop.instance().stop()
http_client = httpclient.AsyncHTTPClient()
http_client.fetch("http://www.google.co.in/", async_call)
ioloop.IOLoop.instance().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment