Skip to content

Add nursery.start and nursery.start_soon - #298

Merged
njsmith merged 8 commits into
python-trio:masterfrom
njsmith:start-task
Aug 21, 2017
Merged

njsmith merged 8 commits into
python-trio:masterfrom
njsmith:start-task

Conversation

@njsmith

@njsmith njsmith commented Aug 21, 2017

Copy link
Copy Markdown
Member

start_soon is just a new name for spawn, except it doesn't return the
new task (in preparation for gh-136, where we're going to stop
emphasizing task objects in the main api)

start is a major new feature: it provides a very simple way to start
up a long running task, while blocking until it's finished whatever
initialization it wants to do. At least... it's simple from the user's
point of view. Internally it's quite tricky indeed. The whole _run.py
file probably needs some refactoring and splitting up, but this is one
of those cases where I think it's best to first get the new
functionality working and nailed down, and then we can see what shape
the new abstractions should be.

Fixes gh-284.

@codecov

codecov Bot commented Aug 21, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #298 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #298      +/-   ##
==========================================
+ Coverage   99.19%   99.21%   +0.02%     
==========================================
  Files          81       81              
  Lines        9777     9966     +189     
  Branches      688      702      +14     
==========================================
+ Hits         9698     9888     +190     
+ Misses         62       61       -1     
  Partials       17       17
Impacted Files Coverage Δ
trio/_core/tests/conftest.py 100% <100%> (ø) ⬆️
trio/_core/tests/test_run.py 100% <100%> (ø) ⬆️
trio/tests/test_ssl.py 100% <100%> (ø) ⬆️
trio/_core/_run.py 100% <100%> (ø) ⬆️
trio/tests/test_highlevel_ssl_helpers.py 100% <0%> (+1.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8aaa002...7fd064b. Read the comment docs.

start_soon is just a new name for spawn, except it doesn't return the
new task (in preparation for python-triogh-136, where we're going to stop
emphasizing task objects in the main api)

start is a major new feature: it provides a very simple way to start
up a long running task, while blocking until it's finished whatever
initialization it wants to do. At least... it's simple from the user's
point of view. Internally it's quite tricky indeed. The whole _run.py
file probably needs some refactoring and splitting up, but this is one
of those cases where I think it's best to first get the new
functionality working and nailed down, and then we can see what shape
the new abstractions should be.

Fixes python-triogh-284.
The new 0.17 release has slightly different ideas about formatting.
@njsmith njsmith mentioned this pull request Aug 21, 2017
15 of 17 tasks
@njsmith
njsmith merged commit 90c54e9 into python-trio:master Aug 21, 2017
@njsmith
njsmith deleted the start-task branch August 21, 2017 19:56
@matham

matham commented Aug 21, 2017

Copy link
Copy Markdown
Contributor

I think there's a typo at https://github.com/python-trio/trio/pull/298/files#diff-e4df893b734a53b4ac0bb2ec532fccbfR926. It should say Like :meth:start_soon.

njsmith added a commit to njsmith/trio that referenced this pull request Aug 21, 2017
@njsmith njsmith mentioned this pull request Aug 21, 2017
@njsmith

njsmith commented Aug 21, 2017

Copy link
Copy Markdown
Member Author

Good catch :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants