-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add nursery.start and nursery.start_soon #298
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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.
Like right now, ctypes is broken, so pip just crashes: https://travis-ci.org/python-trio/trio/jobs/266668451
I think there's a typo at https://github.com/python-trio/trio/pull/298/files#diff-e4df893b734a53b4ac0bb2ec532fccbfR926. It should say Like :meth: |
Thanks to @matham for catching it: python-trio#298 (comment)
Good catch :-) |
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.