Skip to content

Commit 5982286

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

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

jupyter_client/channels.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
from threading import Event
1010
from threading import Thread
1111

12-
import zmq.asyncio
12+
import zmq
13+
from zmq.asyncio import Context
14+
from zmq.asyncio import Socket
1315

1416
from .channelsabc import HBChannelABC
1517
from .session import Session
@@ -49,7 +51,7 @@ class HBChannel(Thread):
4951

5052
def __init__(
5153
self,
52-
context: t.Optional[zmq.asyncio.Context] = None,
54+
context: t.Optional[Context] = None,
5355
session: t.Optional[Session] = None,
5456
address: t.Union[t.Tuple[str, int], str] = "",
5557
):
@@ -193,7 +195,7 @@ def call_handlers(self, since_last_heartbeat: float) -> None:
193195
class ZMQSocketChannel(object):
194196
"""A ZMQ socket in an async API"""
195197

196-
def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = None) -> None:
198+
def __init__(self, socket: Socket, session: Session, loop: t.Any = None) -> None:
197199
"""Create a channel.
198200
199201
Parameters
@@ -207,7 +209,7 @@ def __init__(self, socket: zmq.asyncio.Socket, session: Session, loop: t.Any = N
207209
"""
208210
super().__init__()
209211

210-
self.socket: t.Optional[zmq.asyncio.Socket] = socket
212+
self.socket: t.Optional[Socket] = socket
211213
self.session = session
212214

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

jupyter_client/client.py

Lines changed: 8 additions & 0 deletions
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.Callable[..., t.Union[t.Coroutine[t.Any, t.Any, t.Dict[str, t.Any]], t.Dict[str, t.Any]]]
94+
get_iopub_msg: t.Callable[..., t.Union[t.Coroutine[t.Any, t.Any, t.Dict[str, t.Any]], t.Dict[str, t.Any]]]
95+
get_stdin_msg: t.Callable[..., t.Union[t.Coroutine[t.Any, t.Any, t.Dict[str, t.Any]], t.Dict[str, t.Any]]]
96+
get_control_msg: t.Callable[..., t.Union[t.Coroutine[t.Any, t.Any, t.Dict[str, t.Any]], t.Dict[str, t.Any]]]
97+
wait_for_ready: t.Callable[["KernelClient", t.Optional[float]], t.Union[t.Coroutine[t.Any, t.Any, None], None]]
98+
is_alive: t.Callable[["KernelClient"], t.Union[t.Coroutine[t.Any, t.Any, bool], bool]]
99+
execute_interactive: t.Callable[..., t.Union[t.Coroutine[t.Any, t.Any, t.Dict[str, t.Any]], t.Dict[str, t.Any]]]
100+
93101
# The PyZMQ Context to use for communication with the kernel.
94102
context = Instance(zmq.asyncio.Context)
95103

0 commit comments

Comments
 (0)