Skip to content

Instantly share code, notes, and snippets.

@dgtlctzn
Created December 3, 2021 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgtlctzn/c80c588a9ae29dcd8914260f9f744ae8 to your computer and use it in GitHub Desktop.
Save dgtlctzn/c80c588a9ae29dcd8914260f9f744ae8 to your computer and use it in GitHub Desktop.
Tasks
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