|
9 | 9 | from .connect import connect_channel |
10 | 10 | from .kernel import Kernel |
11 | 11 | from .kernelspec import write_kernelspec |
12 | | -from .message import receive_message, send_message |
13 | 12 |
|
14 | 13 |
|
15 | 14 | cli = typer.Typer() |
@@ -106,34 +105,34 @@ async def start(self) -> None: |
106 | 105 |
|
107 | 106 | async def to_shell(self) -> None: |
108 | 107 | while True: |
109 | | - msg = await receive_message(self.shell_channel) |
| 108 | + msg = await self.shell_channel.arecv_multipart().wait() |
110 | 109 | await self._to_shell_send_stream.send(msg) |
111 | 110 |
|
112 | 111 | async def from_shell(self) -> None: |
113 | 112 | async for msg in self._from_shell_receive_stream: |
114 | | - await send_message(msg, self.shell_channel) |
| 113 | + await self.shell_channel.asend_multipart(msg, copy=True).wait() |
115 | 114 |
|
116 | 115 | async def to_control(self) -> None: |
117 | 116 | while True: |
118 | | - msg = await receive_message(self.control_channel) |
| 117 | + msg = await self.control_channel.arecv_multipart().wait() |
119 | 118 | await self._to_control_send_stream.send(msg) |
120 | 119 |
|
121 | 120 | async def from_control(self) -> None: |
122 | 121 | async for msg in self._from_control_receive_stream: |
123 | | - await send_message(msg, self.control_channel) |
| 122 | + await self.control_channel.asend_multipart(msg, copy=True).wait() |
124 | 123 |
|
125 | 124 | async def to_stdin(self) -> None: |
126 | 125 | while True: |
127 | | - msg = await receive_message(self.stdin_channel) |
| 126 | + msg = await self.stdin_channel.arecv_multipart().wait() |
128 | 127 | await self._to_stdin_send_stream.send(msg) |
129 | 128 |
|
130 | 129 | async def from_stdin(self) -> None: |
131 | 130 | async for msg in self._from_stdin_receive_stream: |
132 | | - await send_message(msg, self.stdin_channel) |
| 131 | + await self.stdin_channel.asend_multipart(msg, copy=True).wait() |
133 | 132 |
|
134 | 133 | async def from_iopub(self) -> None: |
135 | 134 | async for msg in self._from_iopub_receive_stream: |
136 | | - await send_message(msg, self.iopub_channel) |
| 135 | + await self.iopub_channel.asend_multipart(msg, copy=True).wait() |
137 | 136 |
|
138 | 137 |
|
139 | 138 | if __name__ == "__main__": |
|
0 commit comments