def urlfetch_async(request, callback=None):
 http_client = tornado.httpclient.AsyncHTTPClient()
 try:
  http_client.fetch(request, callback)
  result = {JSONTags.SUCCESS: True}
 except tornado.httpclient.HTTPError as http_error:
  logging.error("Error while trying to fetch '{0}': {1}".format(request.url, str(http_error)))
  result = {JSONTags.SUCCESS: False, JSONTags.REASON: hermes_constants.HTTPError}
 except Exception as exception:
  logging.exception("Exception while trying to fetch '{0}': {1}".format(request.url, str(exception)))
  result = {JSONTags.SUCCESS: False, JSONTags.REASON: exception.message}
 http_client.close()
 return result

def urlfetch_async ( request , callback = None ) : http_client = tornado . httpclient . AsyncHTTPClient ( ) try : http_client . fetch ( request , callback ) result = { JSONTags . SUCCESS : True } except tornado . httpclient . HTTPError as http_error : logging . error ( "Error while trying to fetch '{0}': {1}" . format ( request . url , str ( http_error ) ) ) result = { JSONTags . SUCCESS : False , JSONTags . REASON : hermes_constants . HTTPError } except Exception as exception : logging . exception ( "Exception while trying to fetch '{0}': {1}" . format ( request . url , str ( exception ) ) ) result = { JSONTags . SUCCESS : False , JSONTags . REASON : exception . message } http_client . close ( ) return result
uses a tornado async http client to perform http requests .