Async Techniques and Examples in Python Transcripts
Chapter: Built on asyncio
Lecture: The trio-async package
0:00 Before we move on from Trio, I just want to point out
0:02 Trio-async, and I did throw this out at the beginning
0:05 when we talked about Trio, but I want to make it super clear
0:08 if for example, you want to write in Trio
0:10 but somewhere you want to use, say, aiohttp client
0:14 we've seen how awesome that is
0:16 and that's a totally reasonable thing to integrate.
0:18 Or maybe I want to use the async library
0:20 that talks to Postgres.
0:21 Well, for sure, the aiohttp client will not work
0:25 inside of Trio's async methods.
0:28 You'll get some kind of error that it's not
0:30 the right kind of event loop.
0:31 It's not an asyncio event loop, it's a Trio event loop
0:33 and they can't deal with each other.
0:35 If you want to use those libraries in code
0:38 that you write based on Trio, you have to use this library
0:42 to create adapting a layer of asyncio event loop
0:46 over the Trio's event loop.
0:48 Just be aware that you're going to this if you want to use
0:51 any external libraries that are built on top of asyncio.