-
Notifications
You must be signed in to change notification settings - Fork 56
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
Graceful shutdown of interrupted loop #121
Comments
Interesting, |
It seems that My guess is that This, I think, is better discussed at [email protected] Here's what it takes to get this work: 1️⃣ patch
2️⃣ update the MCVE like this:
|
I guess the canonical advice would be along the lines of https://docs.python.org/3/library/asyncio-eventloop.html#set-signal-handlers-for-sigint-and-sigterm Some patches are still needed though 🙈 |
What's the proper way to clean up and close a browser session after the event loop is interrupted?
The following program loads example.com using Arsenic every two seconds forever. However, when the user interrupts the program with a KeyboardInterrupt, the browser session can't successfully be closed.
Stopping this program yields the following error:
and then prints a warning
I can't use the
get_session
context manager because of the API design of my program. How can I make sure I clean up and close the browser session when the event loop is cancelled?The text was updated successfully, but these errors were encountered: