Skip to content
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 new trio.to_thread module for running worker threads #1156

Merged
merged 3 commits into from
Jul 31, 2019

Conversation

njsmith
Copy link
Member

@njsmith njsmith commented Jul 27, 2019

For consistency with trio.from_thread, and to give us a place for
future extensions, like utilities for pushing context managers into
threads.

See gh-810.

For consistency with trio.from_thread, and to give us a place for
future extensions, like utilities for pushing context managers into
threads.

See python-triogh-810.
@njsmith njsmith requested a review from epellis July 27, 2019 07:45
@codecov
Copy link

codecov bot commented Jul 27, 2019

Codecov Report

Merging #1156 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1156      +/-   ##
==========================================
+ Coverage   99.55%   99.55%   +<.01%     
==========================================
  Files         105      106       +1     
  Lines       12716    12717       +1     
  Branches      970      970              
==========================================
+ Hits        12659    12660       +1     
  Misses         36       36              
  Partials       21       21
Impacted Files Coverage Δ
trio/_sync.py 100% <ø> (ø) ⬆️
trio/tests/test_ssl.py 99.71% <ø> (ø) ⬆️
trio/_core/_traps.py 100% <ø> (ø) ⬆️
trio/_core/_entry_queue.py 100% <ø> (ø) ⬆️
trio/from_thread.py 100% <100%> (ø) ⬆️
trio/_socket.py 99.58% <100%> (-0.01%) ⬇️
trio/tests/test_signals.py 100% <100%> (ø) ⬆️
trio/_file_io.py 100% <100%> (ø) ⬆️
trio/tests/test_wait_for_object.py 100% <100%> (ø) ⬆️
trio/_subprocess_platform/waitid.py 100% <100%> (ø) ⬆️
... and 9 more

1 similar comment
@codecov
Copy link

codecov bot commented Jul 27, 2019

Codecov Report

Merging #1156 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1156      +/-   ##
==========================================
+ Coverage   99.55%   99.55%   +<.01%     
==========================================
  Files         105      106       +1     
  Lines       12716    12717       +1     
  Branches      970      970              
==========================================
+ Hits        12659    12660       +1     
  Misses         36       36              
  Partials       21       21
Impacted Files Coverage Δ
trio/_sync.py 100% <ø> (ø) ⬆️
trio/tests/test_ssl.py 99.71% <ø> (ø) ⬆️
trio/_core/_traps.py 100% <ø> (ø) ⬆️
trio/_core/_entry_queue.py 100% <ø> (ø) ⬆️
trio/from_thread.py 100% <100%> (ø) ⬆️
trio/_socket.py 99.58% <100%> (-0.01%) ⬇️
trio/tests/test_signals.py 100% <100%> (ø) ⬆️
trio/_file_io.py 100% <100%> (ø) ⬆️
trio/tests/test_wait_for_object.py 100% <100%> (ø) ⬆️
trio/_subprocess_platform/waitid.py 100% <100%> (ø) ⬆️
... and 9 more

Copy link
Contributor

@epellis epellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. :) Crazy how many instances of a couple method calls we have inside the entire codebase.

@njsmith
Copy link
Member Author

njsmith commented Jul 31, 2019

@epellis I know, for a library that tries to avoid threads we sure do use or mention threads a lot :-)

Want to go ahead and hit the green merge button?

@epellis epellis merged commit 89ef5ff into python-trio:master Jul 31, 2019
@njsmith njsmith deleted the add-to-thread branch July 31, 2019 04:00
@njsmith
Copy link
Member Author

njsmith commented Jul 31, 2019

woot 🎉

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