pub async fn run_dispatch(
read: SplitStream<WebSocketStream<TcpStream>>,
write: SplitSink<WebSocketStream<TcpStream>, Message>,
peer: SocketAddr,
state: Arc<ServerState>,
) -> Result<(), Box<dyn Error>>Expand description
Transport-neutral entry point: drives the JSON-RPC dispatch loop against an already-handshake-completed split WebSocket. Both the standalone car-server binary and embedders (e.g. tokhn-daemon at U7) call this same function.
Concrete typing reflects today’s pipeline (tokio-tungstenite
over TcpStream). U7 is responsible for any further generalization
— for example, by opening an axum WebSocket via tungstenite-native
or by introducing a sink/stream wrapper that adapts axum’s WS to
these concrete types.