-
-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1558 from oremanj/eventual-parent
Add Task.eventual_parent_nursery introspection attribute
- Loading branch information
Showing
4 changed files
with
57 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Tasks spawned with `nursery.start() <trio.Nursery.start>` aren't treated as | ||
direct children of their nursery until they call ``task_status.started()``. | ||
This is visible through the task tree introspection attributes such as | ||
`Task.parent_nursery <trio.lowlevel.Task.parent_nursery>`. Sometimes, though, | ||
you want to know where the task is going to wind up, even if it hasn't finished | ||
initializing yet. To support this, we added a new attribute | ||
`Task.eventual_parent_nursery <trio.lowlevel.Task.eventual_parent_nursery>`. | ||
For a task spawned with :meth:`~trio.Nursery.start` that hasn't yet called | ||
``started()``, this is the nursery that the task was nominally started in, | ||
where it will be running once it finishes starting up. In all other cases, | ||
it is ``None``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters