Coverage for /pythoncovmergedfiles/medio/medio/src/jupyter_server/jupyter_server/services/kernels/connection/abc.py: 100%
12 statements
« prev ^ index » next coverage.py v7.3.3, created at 2023-12-15 06:13 +0000
« prev ^ index » next coverage.py v7.3.3, created at 2023-12-15 06:13 +0000
1from abc import ABC, abstractmethod
2from typing import Any, List
5class KernelWebsocketConnectionABC(ABC):
6 """
7 This class defines a minimal interface that should
8 be used to bridge the connection between Jupyter
9 Server's websocket API and a kernel's ZMQ socket
10 interface.
11 """
13 websocket_handler: Any
15 @abstractmethod
16 async def connect(self):
17 """Connect the kernel websocket to the kernel ZMQ connections"""
19 @abstractmethod
20 async def disconnect(self):
21 """Disconnect the kernel websocket from the kernel ZMQ connections"""
23 @abstractmethod
24 def handle_incoming_message(self, incoming_msg: str) -> None:
25 """Broker the incoming websocket message to the appropriate ZMQ channel."""
27 @abstractmethod
28 def handle_outgoing_message(self, stream: str, outgoing_msg: List[Any]) -> None:
29 """Broker outgoing ZMQ messages to the kernel websocket."""