Skip to main content

run_stdio

Function run_stdio 

Source
pub async fn run_stdio<R, W>(
    server: Arc<AcpServer>,
    reader: R,
    writer: W,
) -> Result<(), Error>
where R: AsyncBufRead + Unpin + Send + 'static, W: AsyncWrite + Unpin + Send + 'static,
Expand description

Serve ACP v1 JSON-RPC over a newline-delimited stream.

Requests are dispatched concurrently so session/cancel can interrupt a running session/prompt. A single writer task serializes responses and notifications, preventing byte interleaving between event and request tasks.