Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
from aiohttp import ClientSession
from pypeln import io
import asyncio
import sys
async def fetch(url, session):
async with session.get(url) as response:
return await
async def main():
r = 10
url = ""
# r = int(sys.argv[1])
# url = "http://localhost:8080/{}"
async with ClientSession() as session:
data = range(r)
await io.each(lambda i: fetch(url, session), data, workers=1000, run = False)
loop = asyncio.get_event_loop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment