Talk Python To Me cover image

#304: asyncio all the things with Omnilib

Talk Python To Me

The Concurrency Limited Version of Gather in Aio Iterator Tools

2min Snip

00:00
Play full episode
The common use case here or the expected use case would be if you're doing something like talking to a whole bunch of network hosts and you want to return the results as they come in. You could use something like aio iter tools to then do things like batch up those results or run another coroutine across every result as it comes in, things like that. The other added benefit in here is that there's also a concurrency limited version of gather. So essentially, it's making sure that the event loop would never see more than 64 active tasks at a time.

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode