Created
December 3, 2021 17:03
-
-
Save dgtlctzn/c80c588a9ae29dcd8914260f9f744ae8 to your computer and use it in GitHub Desktop.
Tasks
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
async def request_urls(urls: List[str]): | |
async with aiohttp.ClientSession() as session: | |
tasks: List[asyncio.Task] = [] | |
for url in urls: | |
tasks.append( | |
asyncio.ensure_future( | |
get_url(session, url) | |
) | |
) | |
return await asyncio.gather(*tasks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment