Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import requests3
import trio
session = requests3.AsyncSession()
async def main():
async def request():
r = await session.get('http://127.0.0.1:8000/uuid', stream=False)
print(await r.json())
return r
for i in range(16):
async with trio.open_nursery() as nursery:
for i in range(512):
nursery.start_soon(request)
print('done!')
trio.run(main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment