|
1 | | -# What? |
2 | | - |
3 | | -This is just some assorted info that may be useful to anyone considering why |
4 | | -certain things in this library are done the way there are and also |
5 | | -as a place to record some important information that I may not always remember |
6 | | -all of, but may need to revisit in the future related to it. |
7 | | - |
8 | | -## Task switching semantic changes in the standard library |
9 | | - |
10 | | -### Before eager tasks |
11 | | - |
12 | | -- await |
13 | | -- async with (both enter and exit) |
14 | | -- async for (per loop) |
15 | | -- return (from a coroutine) |
16 | | -- yield (from a coroutine) |
17 | | -- Raising an exception (that leaves a coroutine) |
18 | | - |
19 | | -### As of eager tasks, the below are included |
20 | | - |
21 | | -- Constructing an asyncio.Task with eager_start=True while the associated event loop is running |
22 | | -- asyncio.create_task |
23 | | -- asyncio.ensure_future (when wrapping a non-future awaitable) |
24 | | -- asyncio.wait_for\* (when any non-future awaitables are waited on) (ensure_future) |
25 | | -- asyncio.as_completed\* (when any non-future awaitables are waited on) (ensure_future) |
26 | | -- asyncio.gather\* (when any non-future awaitables are gathered) (ensure_future) |
27 | | -- asyncio.IocpProactor.accept (unlikely to impact most) (ensure_future on a coro) |
28 | | -- asyncio.StreamReaderProtocol.connection_made (library use, perhaps?) (create task) |
29 | | -- Constructing asyncio.BaseSubprocessTransport (create task) |
30 | | - - Note: extremely unlikely to impact anyone, asyncio.create_subprocess_* doesn't construct this prior to an await. |
31 | | - |
32 | | -\* Likely not a meaningfully new place, awaiting these immediately is the most common use. |
| 1 | +# What? |
| 2 | + |
| 3 | +This is just some assorted info that may be useful to anyone considering why |
| 4 | +certain things in this library are done the way there are and also |
| 5 | +as a place to record some important information that I may not always remember |
| 6 | +all of, but may need to revisit in the future related to it. |
| 7 | + |
| 8 | +## Task switching semantic changes in the standard library |
| 9 | + |
| 10 | +### Before eager tasks |
| 11 | + |
| 12 | +- await |
| 13 | +- async with (both enter and exit) |
| 14 | +- async for (per loop) |
| 15 | +- return (from a coroutine) |
| 16 | +- yield (from a coroutine) |
| 17 | +- Raising an exception (that leaves a coroutine) |
| 18 | + |
| 19 | +### As of eager tasks, the below are included |
| 20 | + |
| 21 | +- Constructing an asyncio.Task with eager_start=True while the associated event loop is running |
| 22 | +- asyncio.create_task |
| 23 | +- asyncio.ensure_future (when wrapping a non-future awaitable) |
| 24 | +- asyncio.wait_for\* (when any non-future awaitables are waited on) (ensure_future) |
| 25 | +- asyncio.as_completed\* (when any non-future awaitables are waited on) (ensure_future) |
| 26 | +- asyncio.gather\* (when any non-future awaitables are gathered) (ensure_future) |
| 27 | +- asyncio.IocpProactor.accept (unlikely to impact most) (ensure_future on a coro) |
| 28 | +- asyncio.StreamReaderProtocol.connection_made (library use, perhaps?) (create task) |
| 29 | +- Constructing asyncio.BaseSubprocessTransport (create task) |
| 30 | + - Note: extremely unlikely to impact anyone, asyncio.create_subprocess_* doesn't construct this prior to an await. |
| 31 | + |
| 32 | +\* Likely not a meaningfully new place, awaiting these immediately is the most common use. |
0 commit comments