File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ to this::
7676
7777 async def trio_main():
7878 async with trio_asyncio.open_loop() as loop:
79- await trio .run_asyncio(async_main)
79+ await loop .run_asyncio(async_main)
8080
8181 def main():
8282 trio.run(trio_main)
@@ -205,18 +205,24 @@ Calling asyncio from Trio
205205Pass the function and any arguments to ``loop.run_asyncio() ``. This method
206206conforms to Trio's standard task semantics.
207207
208+ :func: `trio_asyncio.run_asyncio ` is a shortcut for
209+ ``asyncio.get_event_loop().run_asyncio ``.
210+
208211::
209212
210213 async def some_asyncio_code(foo):
211214 await asyncio.sleep(1)
212215 return foo*20
213216
214- res = await trio .run_asyncio(some_trio_code, 21)
217+ res = await trio_asyncio .run_asyncio(some_trio_code, 21)
215218 assert res == 420
216219
217220.. autodoc: trio_asyncio.run_asyncio
218221
219- If you already have a coroutine you need to await, call ``loop.run_coroutine() ``:
222+ If you already have a coroutine you need to await, call ``loop.run_coroutine() ``.
223+
224+ :func: `trio_asyncio.run_coroutine ` is a shortcut for
225+ ``asyncio.get_event_loop().run_coroutine ``.
220226
221227::
222228
You can’t perform that action at this time.
0 commit comments