Expand description
One-call broker adoption: negotiate → dial → ready-to-talk client (#433 R1).
connect_to_backend returns a raw
BackendConnection — a bare
socket the consumer must still wrap in a FrameClient before it can send
a single request. Every consumer (zccache, soldr, clud, fbuild) repeats the
same three lines: check the disable env, call connect_to_backend, wrap the
stream. BrokerSession::adopt is that recipe, owned once here so the
contract is a single call:
use running_process::broker::adopt::BrokerSession;
use running_process::broker::client::ConnectBackendRequest;
let request = ConnectBackendRequest::new("broker.sock", "zccache", "1.11.20", "1.11.20");
let mut session = BrokerSession::adopt(request)?;
let reply = session.request(0x7A63, b"ping".to_vec())?;
assert_eq!(reply.payload, b"pong");The blocking BrokerSession is the wire-of-record; the async
[AsyncBrokerSession] (feature client-async, #433 R3) is a thin
spawn_blocking wrapper so tokio daemons get the same one-call adoption
without re-implementing the negotiation against AsyncRead/AsyncWrite.
Structs§
- Broker
Session - A negotiated, dialed, and framed broker backend connection.
- Owned
Backend Io - A live negotiated backend socket handed back as an owned OS handle (#720).
Enums§
- Adopt
Error - Errors from
BrokerSession::adopt/AsyncBrokerSession::adopt. - Into
Backend IoError - Errors from
BrokerSession::into_backend_io/ [AsyncBrokerSession::into_backend_io].