Talk Python To Me cover image

#385: Higher level Python asyncio with AnyIO

Talk Python To Me

00:00

Async Tasks - Thread Locals

Asyncaiel allows you to specify a limiter and it uses the default limiter which has capacity of 40 threads. Much more than that, you end up with memory and context switching issues. So basically, if you've got some function that is not Async, but you want to be able to await it, so that basically run it on a background thread. Here, you just say any IO dot to thread, and then dot run sync, and you give it the function to call, and now you can await it. And it runs on a backgroundthread in this thread pool, which is really nice.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app