Async Techniques and Examples in Python Transcripts
Chapter: Built on asyncio
Lecture: The trio-async package
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Before we move on from Trio, I just want to point out Trio-async, and I did throw this out at the beginning
0:06
when we talked about Trio, but I want to make it super clear if for example, you want to write in Trio
0:11
but somewhere you want to use, say, aiohttp client we've seen how awesome that is and that's a totally reasonable thing to integrate.
0:19
Or maybe I want to use the async library that talks to Postgres. Well, for sure, the aiohttp client will not work inside of Trio's async methods.
0:29
You'll get some kind of error that it's not the right kind of event loop. It's not an asyncio event loop, it's a Trio event loop
0:34
and they can't deal with each other. If you want to use those libraries in code that you write based on Trio, you have to use this library
0:43
to create adapting a layer of asyncio event loop over the Trio's event loop. Just be aware that you're going to this if you want to use
0:52
any external libraries that are built on top of asyncio.