python-trio / trio-asyncio

a re-implementation of the asyncio mainloop on top of Trio
Other
188 stars 37 forks source link

Allow multiple calls to loop.stop #60

Closed tjstum closed 5 years ago

tjstum commented 5 years ago

Calling loop.stop and then immediately proceeding to exit the open_loop's context (without hitting any checkpoints) causes the program to hang forever

Fix by reusing the same waiter event across multiple calls to stop

Fixes #58

tjstum commented 5 years ago

@smurfix I know you suggested a mention in the docs. It looked reasonable to fix, so I had a go at it. If you'd prefer just a doc fix, no worries, I can just do that!

oremanj commented 5 years ago

Looks good. Can you add a newsfragment?

codecov[bot] commented 5 years ago

Codecov Report

Merging #60 into master will increase coverage by 0.22%. The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
+ Coverage   73.33%   73.55%   +0.22%     
==========================================
  Files          11       11              
  Lines        1264     1267       +3     
  Branches      165      166       +1     
==========================================
+ Hits          927      932       +5     
+ Misses        282      281       -1     
+ Partials       55       54       -1
Impacted Files Coverage Δ
trio_asyncio/base.py 85.42% <100%> (+0.03%) :arrow_up:
trio_asyncio/async_.py 85.48% <100%> (+0.48%) :arrow_up:
trio_asyncio/handles.py 83.17% <0%> (+1.86%) :arrow_up:
smurfix commented 5 years ago

added to "next" branch