Skip to content

Commit 3613ca6

Browse files
authored
Merge pull request #309 from njsmith/deprecations-for-136
Deprecations for #136 and #284
2 parents 058c985 + b290a96 commit 3613ca6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1127
-793
lines changed

docs/source/design.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ where it motivates the use of "nurseries"::
309309

310310
async def parent():
311311
async with trio.open_nursery() as nursery:
312-
nursery.spawn(child)
312+
nursery.start_soon(child)
313313

314314
(See :ref:`tasks` for full details.)
315315

@@ -326,7 +326,7 @@ In `the blog post
326326
<https://vorpus.org/blog/some-thoughts-on-asynchronous-api-design-in-a-post-asyncawait-world/#c-c-c-c-causality-breaker>`__
327327
I called out a nice feature of curio's spawning API, which is that
328328
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
330330
guaranteed to be causal. One limitation though is that this invariant
331331
is actually not very predictive: in curio there are lots of async
332332
functions that could spawn off children and violate causality, but
@@ -338,11 +338,11 @@ one. In trio:
338338
* Sync functions can't create nurseries, because nurseries require an
339339
``async with``
340340

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!
346346

347347
* The only way to violate causality (which is an important feature,
348348
just one that needs to be handled carefully) is to explicitly create
@@ -417,9 +417,9 @@ Specific style guidelines
417417
and the ``nowait`` version raises :exc:`trio.WouldBlock` if it would block.
418418

419419
* 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`.)
423423

424424
* ...we should, but currently don't, have a solid convention to
425425
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
466466
the rest of trio, and could (possibly should?) be extracted into their
467467
own independent packages:
468468

469-
* ``_result.py``: Defines :class:`Result`.
469+
* ``_result.py``: Defines :class:`~trio.hazmat.Result`.
470470

471471
* ``_multierror.py``: Implements :class:`MultiError` and associated
472472
infrastructure.
@@ -478,8 +478,9 @@ The most important submodule, where everything is integrated, is
478478
``_run.py``. (This is also by far the largest submodule; it'd be nice
479479
to factor bits of it out with possible, but it's tricky because the
480480
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.
483484

484485
The one thing that *isn't* in ``_run.py`` is I/O handling. This is
485486
delegated to an ``IOManager`` class, of which there are currently

0 commit comments

Comments
 (0)