Connector for the stream-backed paths (URL, user-supplied ``Transport``).
(transport: Transport)
| 60 | |
| 61 | |
| 62 | def _connect_transport(transport: Transport) -> _Connector: |
| 63 | """Connector for the stream-backed paths (URL, user-supplied ``Transport``).""" |
| 64 | |
| 65 | async def connect(exit_stack: AsyncExitStack, _mode: ConnectMode, _raise_exceptions: bool) -> Dispatcher[Any]: |
| 66 | read_stream, write_stream = await exit_stack.enter_async_context(transport) |
| 67 | return JSONRPCDispatcher(read_stream, write_stream) |
| 68 | |
| 69 | return connect |
| 70 | |
| 71 | |
| 72 | def _connect_inproc(server: Server[Any]) -> _Connector: |