@@ -309,7 +309,7 @@ where it motivates the use of "nurseries"::
309
309
310
310
async def parent():
311
311
async with trio.open_nursery() as nursery:
312
- nursery.spawn (child)
312
+ nursery.start_soon (child)
313
313
314
314
(See :ref: `tasks ` for full details.)
315
315
@@ -326,7 +326,7 @@ In `the blog post
326
326
<https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#c-c-c-c-causality-breaker> `__
327
327
I called out a nice feature of curio's spawning API, which is that
328
328
since spawning is the only way to break causality, and in curio
329
- ``spawn `` is async, this means that in curio sync functions are
329
+ ``spawn `` is async, which means that in curio sync functions are
330
330
guaranteed to be causal. One limitation though is that this invariant
331
331
is actually not very predictive: in curio there are lots of async
332
332
functions that could spawn off children and violate causality, but
@@ -338,11 +338,11 @@ one. In trio:
338
338
* Sync functions can't create nurseries, because nurseries require an
339
339
``async with ``
340
340
341
- * Any async function can create a nursery and spawn new tasks... but
342
- creating a nursery *allows task spawning without allowing causality
343
- breaking *, because the children have to exit before the function is
344
- allowed to return. So we can preserve causality without having to
345
- give up concurrency!
341
+ * Any async function can create a nursery and start new tasks... but
342
+ creating a nursery *allows task starting but does not permit
343
+ causality breaking *, because the children have to exit before the
344
+ function is allowed to return. So we can preserve causality without
345
+ having to give up concurrency!
346
346
347
347
* The only way to violate causality (which is an important feature,
348
348
just one that needs to be handled carefully) is to explicitly create
@@ -417,9 +417,9 @@ Specific style guidelines
417
417
and the ``nowait `` version raises :exc: `trio.WouldBlock ` if it would block.
418
418
419
419
* The word ``monitor `` is used for APIs that involve an
420
- :class: `UnboundedQueue ` receiving some kind of events. (Examples:
421
- nursery ``.monitor `` attribute, some of the low-level I/O functions in
422
- :mod: `trio.hazmat `.)
420
+ :class: `trio.hazmat. UnboundedQueue ` receiving some kind of events.
421
+ (Examples: nursery ``.monitor `` attribute, some of the low-level I/O
422
+ functions in :mod: `trio.hazmat `.)
423
423
424
424
* ...we should, but currently don't, have a solid convention to
425
425
distinguish between functions that take an async callable and those
@@ -466,7 +466,7 @@ There are three notable sub-modules that are largely independent of
466
466
the rest of trio, and could (possibly should?) be extracted into their
467
467
own independent packages:
468
468
469
- * ``_result.py ``: Defines :class: `Result `.
469
+ * ``_result.py ``: Defines :class: `~trio.hazmat. Result `.
470
470
471
471
* ``_multierror.py ``: Implements :class: `MultiError ` and associated
472
472
infrastructure.
@@ -478,8 +478,9 @@ The most important submodule, where everything is integrated, is
478
478
``_run.py ``. (This is also by far the largest submodule; it'd be nice
479
479
to factor bits of it out with possible, but it's tricky because the
480
480
core functionality genuinely is pretty intertwined.) Notably, this is
481
- where cancel scopes, nurseries, and :class: `Task ` are defined; it's
482
- also where the scheduler state and :func: `trio.run ` live.
481
+ where cancel scopes, nurseries, and :class: `~trio.hazmat.Task ` are
482
+ defined; it's also where the scheduler state and :func: `trio.run `
483
+ live.
483
484
484
485
The one thing that *isn't * in ``_run.py `` is I/O handling. This is
485
486
delegated to an ``IOManager `` class, of which there are currently
0 commit comments