pub struct ClusterSync { /* private fields */ }Expand description
Propagates channel subscriptions and fans published messages out across the cluster via beamr process groups (SRV-005 R5/R6).
Implementations§
Source§impl ClusterSync
impl ClusterSync
Sourcepub fn new(
pg: Arc<PgRegistry>,
atoms: Arc<AtomTable>,
connections: ConnectionManager,
local_node: Atom,
resolver: Arc<ClusterResolver>,
) -> Self
pub fn new( pg: Arc<PgRegistry>, atoms: Arc<AtomTable>, connections: ConnectionManager, local_node: Atom, resolver: Arc<ClusterResolver>, ) -> Self
Builds a sync over the scheduler’s pg registry and distribution
connections. local_node is this node’s distribution atom (interned from
the configured node name in the SAME atom table).
Sourcepub fn set_peer_listener(&self, listener: PeerListener) -> bool
pub fn set_peer_listener(&self, listener: PeerListener) -> bool
Installs the listener every peer join and leave is reported to. A second listener is refused (answers false): the first keeps the seat.
Sourcepub fn remote_targets(&self, channel: &str) -> Vec<RemoteMember>
pub fn remote_targets(&self, channel: &str) -> Vec<RemoteMember>
Remote members of channel’s group (for publish fan-out and tests).
Source§impl ClusterSync
impl ClusterSync
Sourcepub fn on_peer_join(&self, node: Atom)
pub fn on_peer_join(&self, node: Atom)
R5 backfill: re-advertise every local subscription to a newly-joined peer.
Sourcepub fn on_peer_leave(&self, node: Atom)
pub fn on_peer_leave(&self, node: Atom)
R6 is automatic (beamr purges the departed node’s remote members via its connection-down hook). This logs the cleanup for operators.
Trait Implementations§
Source§impl Clone for ClusterSync
impl Clone for ClusterSync
Source§impl ClusterObserver for ClusterSync
impl ClusterObserver for ClusterSync
Source§fn on_subscribe(&self, channel: &str, subscriber_pid: u64)
fn on_subscribe(&self, channel: &str, subscriber_pid: u64)
A local subscriber (beamr pid
subscriber_pid) joined channel.Source§fn on_unsubscribe(&self, channel: &str, subscriber_pid: u64)
fn on_unsubscribe(&self, channel: &str, subscriber_pid: u64)
A local subscriber (beamr pid
subscriber_pid) left channel, once per
departure: from the host thread of an explicit unsubscribe, or, when the
subscription was dropped without one (its connection closed, it was
shed), from the channel actor’s thread as it prunes the dead subscriber.
On the actor’s thread the observer must not wait on that channel.Source§fn on_publish(&self, channel: &str, envelope: &Envelope)
fn on_publish(&self, channel: &str, envelope: &Envelope)
A message was published to
channel on this node; the observer may fan it
out to remote subscribers.Auto Trait Implementations§
impl !RefUnwindSafe for ClusterSync
impl !UnwindSafe for ClusterSync
impl Freeze for ClusterSync
impl Send for ClusterSync
impl Sync for ClusterSync
impl Unpin for ClusterSync
impl UnsafeUnpin for ClusterSync
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more