Skip to content

Commit d64444d

Browse files
authored
Merge pull request #822 from vidartf/async-restarter
2 parents c02471e + ae7772e commit d64444d

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

.github/workflows/downstream.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ jobs:
7676
git clone https://github.com/jupyter/jupyter_kernel_test.git
7777
cd jupyter_kernel_test
7878
conda env update --name jupyter_kernel_test --file environment.yml
79-
conda install -c conda-forge xeus-cling
8079
pip install -e ".[test]"
8180
python -m unittest -v
8281

jupyter_client/ioloop/restarter.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
"""
66
# Copyright (c) Jupyter Development Team.
77
# Distributed under the terms of the Modified BSD License.
8-
import asyncio
98
import time
109
import warnings
1110

1211
from traitlets import Instance
13-
from zmq.eventloop import ioloop
1412

1513
from jupyter_client.restarter import KernelRestarter
16-
from jupyter_client.utils import run_sync
1714

1815

1916
class IOLoopKernelRestarter(KernelRestarter):
@@ -27,19 +24,19 @@ def _loop_default(self):
2724
DeprecationWarning,
2825
stacklevel=4,
2926
)
27+
from zmq.eventloop import ioloop
28+
3029
return ioloop.IOLoop.current()
3130

3231
_pcallback = None
3332

3433
def start(self):
3534
"""Start the polling of the kernel."""
3635
if self._pcallback is None:
37-
if asyncio.iscoroutinefunction(self.poll):
38-
cb = run_sync(self.poll)
39-
else:
40-
cb = self.poll
41-
self._pcallback = ioloop.PeriodicCallback(
42-
cb,
36+
from tornado.ioloop import PeriodicCallback
37+
38+
self._pcallback = PeriodicCallback(
39+
self.poll,
4340
1000 * self.time_to_dead,
4441
)
4542
self._pcallback.start()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies = [
2929
"nest-asyncio>=1.5.4",
3030
"python-dateutil>=2.8.2",
3131
"pyzmq>=23.0",
32-
"tornado>=6.0",
32+
"tornado>=6.2",
3333
"traitlets",
3434
]
3535

0 commit comments

Comments
 (0)