Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 7f75edb

Browse files
support async kernel in _request_jupyter_config
1 parent 3cd2da4 commit 7f75edb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

‎jupyter_dash/comms.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import asyncio
12
import IPython
23
from ipykernel.comm import Comm
4+
import nest_asyncio
35
import time
46
import sys
57

@@ -66,7 +68,12 @@ def capture_event(stream, ident, parent):
6668
if _jupyter_comm_response_received():
6769
break
6870

69-
kernel.do_one_iteration()
71+
if asyncio.iscoroutinefunction(kernel.do_one_iteration):
72+
nest_asyncio.apply()
73+
loop = asyncio.get_event_loop()
74+
loop.run_until_complete(kernel.do_one_iteration())
75+
else:
76+
kernel.do_one_iteration()
7077

7178
# Stop capturing events, revert the kernel shell handler to the default
7279
# execute_request behavior

‎requirements.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ retrying
55
ipython
66
ipykernel
77
ansi2html
8+
nest-asyncio

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /