-
Notifications
You must be signed in to change notification settings - Fork 297
Closed
Description
async is_alive() can return:
- an awaited coroutine if it was created by an
AsyncKernelManager
. - or its parent's is_alive() if it was created by a
KernelManager
which is notAsyncKernelManager
. - or the heartbeat's is_beating() if we don't have access to the kernel manager that created it but we have a heartbeat.
- or True if we don't even have a heartbeat.
Cases 1. and 4. are fine, but 2. and 3. could potentially return a non-awaited coroutine. This is causing problems e.g. in jupyter/nbclient#138, but I think the main issue is that we don't know the objects that we are manipulating any more, because we are trying to have a single code base that works for async and non-async. I also think that we are allowing for too much freedom, for instance mixing a non async kernel manager and an async kernel client. This is becoming too complicated.
I think adding type annotations, as @MSeal suggested in #553, will help us understand and improve the situation.
Metadata
Metadata
Assignees
Labels
No labels