Skip to content

Instantly share code, notes, and snippets.

@coldnight coldnight/
Last active Jul 22, 2016

What would you like to do?
def _proxy(method, *args, **kwargs):
ret = yield method(*args, **kwargs)
except ErrorYouWantCatch:
# logging or something else
ret = None
raise gen.Return(ret)
def get(self):
http_client = AsyncHTTPClient()
response1, response2 = yield [_proxy( http_client.fetch, url1),
_proxy( http_client.fetch, url2)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.