Skip to content

Commit a86c5b6

Browse files
committed
Ensure KernelClient's API is complete
1 parent c817714 commit a86c5b6

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

jupyter_client/channels.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from threading import Event
1010
from threading import Thread
1111

12-
import zmq.asyncio
12+
from zmq.asyncio import Context
13+
from zmq.asyncio import Socket
1314

1415
from .channelsabc import HBChannelABC
1516
from .session import Session
@@ -49,7 +50,7 @@ class HBChannel(Thread):
4950

5051
def __init__(
5152
self,
52-
context: t.Optional[zmq.asyncio.Context] = None,
53+
context: t.Optional[Context] = None,
5354
session: t.Optional[Session] = None,
5455
address: t.Union[t.Tuple[str, int], str] = "",
5556
):
@@ -193,7 +194,7 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193194
class ZMQSocketChannel(object):
194195
"""A ZMQ socket in an async API"""
195196

196-
def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = None) -> None:
197+
def __init__(self, socket: Socket, session: Session, loop: t.Any = None) -> None:
197198
"""Create a channel.
198199
199200
Parameters
@@ -207,7 +208,7 @@ def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = N
207208
"""
208209
super().__init__()
209210

210-
self.socket: t.Optional[zmq.asyncio.Socket] = socket
211+
self.socket: t.Optional[Socket] = socket
211212
self.session = session
212213

213214
async def _recv(self, **kwargs: t.Any) -> t.Dict[str, t.Any]:

jupyter_client/client.py

+8
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ class KernelClient(ConnectionFileMixin):
9090
:meth:`get_shell_msg` to fetch messages from the shell channel.
9191
"""
9292

93+
get_shell_msg: t.Union[t.Callable, t.Awaitable]
94+
get_iopub_msg: t.Union[t.Callable, t.Awaitable]
95+
get_stdin_msg: t.Union[t.Callable, t.Awaitable]
96+
get_control_msg: t.Union[t.Callable, t.Awaitable]
97+
wait_for_ready: t.Union[t.Callable, t.Awaitable]
98+
is_alive: t.Union[t.Callable, t.Awaitable]
99+
execute_interactive: t.Union[t.Callable, t.Awaitable]
100+
93101
# The PyZMQ Context to use for communication with the kernel.
94102
context = Instance(zmq.asyncio.Context)
95103

0 commit comments

Comments
 (0)