-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Replace BaseThread's add_task with start_soon #1300
base: main
Are you sure you want to change the base?
Conversation
I updated the PR with my latest changes in #1291. |
ipykernel/thread.py
Outdated
try: | ||
run(self._main) | ||
except Exception: | ||
pass |
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.
Do you want to at least log something if there is an exception ? It seems weird to me to swallow exception, but I'll trust you there.
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.
True, but I'm not sure if this would play well with threads like iostream, which does something with writing to stdout
/stderr
?
Maybe the exception could be made available through a method instead?
The lint errors have been fixed on main, and the other failures are the same as main, so +1 to merge. |
This PR replaces a
BaseThread
'sadd_task()
method withstart_soon()
. The new name is less confusing as it's the same as in AnyIO, and it allows to start a task in the thread even after the thread has been started.We also get rid of
_IOPubThread
, which has no reason to be different than aBaseThread
.(from #1291)