-
Notifications
You must be signed in to change notification settings - Fork 993
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
Complete program execution on exceptions in async_mode=True #231
Conversation
Pull request with implementation as suggested in guidance-ai#206.
task.cancel() | ||
loop.run_until_complete(asyncio.sleep(0)) # give the loop a chance to cancel the tasks | ||
|
||
# TODO: do we really want to close the loop? what if it is used by others? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@slundberg is it possible that the loop
is shared with other usages and that this loop.close()
should not be called (and be the caller's resposability to do that?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great point.
@microsoft-github-policy-service agree company="Realm" |
Thanks! Will dig into this soon. |
Codecov Report
@@ Coverage Diff @@
## main #231 +/- ##
==========================================
- Coverage 67.74% 67.63% -0.11%
==========================================
Files 54 54
Lines 2970 2985 +15
==========================================
+ Hits 2012 2019 +7
- Misses 958 966 +8
|
Thank you again for this PR @jprafael ! It looks good to me, and I am merging now. |
Fixes and adds unit test for #206. Uses the proposed implementation with extra stuff to clean-up tasks after completion.