Skip to content

Updates for client 8 #1188

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

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jupyter_server/gateway/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ async def shutdown_kernel(self, kernel_id, now=False, restart=False):
The purpose of this shutdown is to restart the kernel (True)
"""
km = self.get_kernel(kernel_id)
await km.shutdown_kernel(now=now, restart=restart)
await ensure_async(km.shutdown_kernel(now=now, restart=restart))
self.remove_kernel(kernel_id)

async def restart_kernel(self, kernel_id, now=False, **kwargs):
Expand All @@ -156,7 +156,7 @@ async def restart_kernel(self, kernel_id, now=False, **kwargs):
The id of the kernel to restart.
"""
km = self.get_kernel(kernel_id)
await km.restart_kernel(now=now, **kwargs)
await ensure_async(km.restart_kernel(now=now, **kwargs))

async def interrupt_kernel(self, kernel_id, **kwargs):
"""Interrupt a kernel by its kernel uuid.
Expand All @@ -167,14 +167,14 @@ async def interrupt_kernel(self, kernel_id, **kwargs):
The id of the kernel to interrupt.
"""
km = self.get_kernel(kernel_id)
await km.interrupt_kernel()
await ensure_async(km.interrupt_kernel())

async def shutdown_all(self, now=False):
"""Shutdown all kernels."""
kids = list(self._kernels)
for kernel_id in kids:
km = self.get_kernel(kernel_id)
await km.shutdown_kernel(now=now)
await ensure_async(km.shutdown_kernel(now=now))
self.remove_kernel(kernel_id)

async def cull_kernels(self):
Expand Down
2 changes: 1 addition & 1 deletion jupyter_server/services/kernels/kernelmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ async def _async_start_kernel( # type:ignore[override]
# see https://github.com/jupyter-server/jupyter_server/issues/1165
# this assignment is technically incorrect, but might need a change of API
# in jupyter_client.
start_kernel = _async_start_kernel
start_kernel = _async_start_kernel # type:ignore[assignment]

async def _finish_kernel_start(self, kernel_id):
"""Handle a kernel that finishes starting."""
Expand Down