pub struct StreamSpec {
pub kind: u8,
pub lane_capacity: usize,
pub buffer_bytes: usize,
}Expand description
Which segment a Streams table uses, and how big its lanes and
rings are.
One fleet can hold several independent stream tables. They are not
interchangeable: a relay carrying response bodies wants a ring sized to
a body, while a control channel carrying short frames is faster with a
small one, and a lane is a ceiling on concurrent streams per node. Each
names its own kind, and a kind is a fleet-wide identity — every process
opening it must pass the same geometry, and the segment’s header
refuses a peer that does not. StreamSpec::DEFAULT is what
Streams::new opens; its values are the compile-time geometry.
Fields§
§kind: u8The Orbit SHM kind, and with it the segment name.
lane_capacity: usizeStreams one fleet node can hold open at once. A power of two, at most 65 536.
buffer_bytes: usizeBytes each direction holds before its writer waits. A power of two.
Implementations§
Source§impl StreamSpec
impl StreamSpec
pub const DEFAULT: Self
pub const fn new(kind: u8, lane_capacity: usize, buffer_bytes: usize) -> Self
Sourcepub const fn lane_bytes(&self) -> usize
pub const fn lane_bytes(&self) -> usize
The segment one node’s streams occupy at most: every slot’s two rings. Memory is backed as it is touched, but this is the ceiling a deployment is choosing when it picks a lane and a ring.