Expand description
Embed connection lifecycle — Phase 6B-7 part 4.
Per ADR 0017, embeddings live on a separate socket from v1 and
v2. This module mirrors lifecycle_v2.rs but for the embed wire
types (inferd_proto::embed::EmbedRequest / EmbedResponse).
Single-frame request / single-frame response — embeddings are not streamed (the result is a complete vector, there is nothing to stream). The connection stays open for the next request.
Per request:
- Read one NDJSON frame, parse as
EmbedRequest. EmbedRequest::resolve()— structural validation.- Admission gate (same Admission shared with v1 / v2; one slot is one slot regardless of wire surface).
- Dispatch through the router; check the chosen backend’s
capabilities().embedflag — backends that don’t support embeddings yieldError{EmbedUnsupported, ...}. backend.embed(resolved)— errors map to embed error codes.- Emit a single
EmbedResponse::EmbeddingsorEmbedResponse::Errorframe, then loop for the next request.
Re-exports§
pub use crate::lifecycle::AcceptContext;
Functions§
- handle_
embed_ connection - Handle one accepted embed client connection.
- serve_
tcp_ embed - Serve an embed TCP listener.
- serve_
uds_ embed - Serve an embed Unix domain socket listener.