pub struct Membership { /* private fields */ }Expand description
Tracks cluster peers from beamr’s ordered connection-event stream.
Cloning shares one tracker: the arm, the peer set, the effect FIFO, and the
counters all live behind a single Arc.
Implementations§
Source§impl Membership
impl Membership
Sourcepub fn new(connections: ConnectionManager, atoms: Arc<AtomTable>) -> Self
pub fn new(connections: ConnectionManager, atoms: Arc<AtomTable>) -> Self
Arms a membership tracker on connections.
The subscription is established here, not later: before this returns, the
callback has been handed a synthetic Up for every live peer under
beamr’s dispatch gate, so the tracker’s initial view is atomic with
respect to the ordered stream that follows. Peers already connected by
seed discovery therefore appear immediately, and their join effects are
queued for the consumer.
Sourcepub fn peer_names(&self) -> Vec<String>
pub fn peer_names(&self) -> Vec<String>
The currently-tracked peers as resolved node-name strings.
Sourcepub fn events_observed(&self) -> u64
pub fn events_observed(&self) -> u64
How many connection events this tracker has been handed. Flat means the backend told us nothing, which is the only reason membership may be flat.
Sourcepub fn consumer_wakes(&self) -> u64
pub fn consumer_wakes(&self) -> u64
How many times the effect FIFO has been drained — the consumer-side wake count. A drain runs only because a delta was pushed or shutdown was signalled; spurious condvar wakeups are absorbed by the wait predicate and perform no work, so they are not counted. Includes the one synchronous drain that applies the initial view at bring-up.
Sourcepub fn source_snapshots(&self) -> u64
pub fn source_snapshots(&self) -> u64
How many times this tracker has asked the backend for an initial view. Exactly one per arm, for the lifetime of the tracker — there is no cadence, so this never grows again.
Sourcepub fn queue_high_water(&self) -> usize
pub fn queue_high_water(&self) -> usize
The deepest the lossless effect FIFO has ever been. The disclosed bound on the unbounded-queue tradeoff.
Sourcepub fn pending_effects(&self) -> usize
pub fn pending_effects(&self) -> usize
Effects queued but not yet applied by the consumer.
Trait Implementations§
Source§impl Clone for Membership
impl Clone for Membership
Source§fn clone(&self) -> Membership
fn clone(&self) -> Membership
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more