Last active
August 8, 2017 14:29
-
-
Save gbigwood/4371ce5a094857a48d1f330082f77ebb to your computer and use it in GitHub Desktop.
really basic coroutine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
async def requests_coroutine(name, url): | |
print(name, requests.get(url)) | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(requests_coroutine("a", "http://www.google.com")) | |
loop.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment