pub struct SidecarConfig {
pub name: String,
pub command: Option<String>,
pub socket: Option<String>,
pub shm_size: u64,
pub health_interval_ms: u64,
pub timeout_ms: u64,
pub retry: u8,
pub pool_size: usize,
pub max_in_flight: u64,
pub auth_token: Option<String>,
pub failover: Option<FailoverConfig>,
pub reconnect_policy: ReconnectPolicy,
}Expand description
Configuration for a single sidecar.
Fields§
§name: StringSidecar name (used for registry lookup and SHM naming).
command: Option<String>Optional command to auto-spawn the sidecar process. If None, sidecar must self-register via UDS.
socket: Option<String>Unix domain socket path. Defaults to /tmp/vil_sidecar_{name}.sock.
shm_size: u64SHM region size in bytes. Default: 64 MB.
health_interval_ms: u64Health check interval in milliseconds. Default: 5000.
timeout_ms: u64Invocation timeout in milliseconds. Default: 30000.
retry: u8Number of retries on invocation failure. Default: 0.
pool_size: usizeNumber of concurrent connections to the sidecar. Default: 4.
max_in_flight: u64Maximum number of in-flight requests (0 = unlimited). Default: 1000.
auth_token: Option<String>Optional authentication token for handshake.
failover: Option<FailoverConfig>Failover configuration.
reconnect_policy: ReconnectPolicyReconnect policy for dropped connections.
Implementations§
Source§impl SidecarConfig
impl SidecarConfig
Sourcepub fn new(name: impl Into<String>) -> SidecarConfig
pub fn new(name: impl Into<String>) -> SidecarConfig
Create a minimal config with just a name.
Sourcepub fn command(self, cmd: impl Into<String>) -> SidecarConfig
pub fn command(self, cmd: impl Into<String>) -> SidecarConfig
Set the spawn command.
Sourcepub fn timeout(self, ms: u64) -> SidecarConfig
pub fn timeout(self, ms: u64) -> SidecarConfig
Set the timeout in milliseconds.
Sourcepub fn shm_size(self, bytes: u64) -> SidecarConfig
pub fn shm_size(self, bytes: u64) -> SidecarConfig
Set the SHM size.
Sourcepub fn pool_size(self, n: usize) -> SidecarConfig
pub fn pool_size(self, n: usize) -> SidecarConfig
Set the connection pool size.
Sourcepub fn max_in_flight(self, n: u64) -> SidecarConfig
pub fn max_in_flight(self, n: u64) -> SidecarConfig
Set the maximum number of in-flight requests (0 = unlimited).
Sourcepub fn reconnect_max_retries(self, n: u32) -> SidecarConfig
pub fn reconnect_max_retries(self, n: u32) -> SidecarConfig
Set the maximum reconnect retries.
Sourcepub fn reconnect_backoff_ms(self, base: u64, max: u64) -> SidecarConfig
pub fn reconnect_backoff_ms(self, base: u64, max: u64) -> SidecarConfig
Set the reconnect backoff parameters (base and max in milliseconds).
Sourcepub fn socket_path(&self) -> String
pub fn socket_path(&self) -> String
Resolve the socket path (use explicit or generate from name).
Trait Implementations§
Source§impl Clone for SidecarConfig
impl Clone for SidecarConfig
Source§fn clone(&self) -> SidecarConfig
fn clone(&self) -> SidecarConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more