pub struct BarrierCoordinator { /* private fields */ }Expand description
Cross-instance barrier coordination.
Implementations§
Source§impl BarrierCoordinator
impl BarrierCoordinator
Sourcepub fn set_leader_election(
&mut self,
instance_id: NodeId,
members_rx: Receiver<Vec<NodeInfo>>,
)
pub fn set_leader_election( &mut self, instance_id: NodeId, members_rx: Receiver<Vec<NodeInfo>>, )
Configure the leader election state used to validate incoming leader identity.
Sourcepub async fn start_server(
&self,
bind_addr: SocketAddr,
advertise_host: Option<String>,
query_handler: QueryHandlerSlot,
) -> Result<SocketAddr, String>
pub async fn start_server( &self, bind_addr: SocketAddr, advertise_host: Option<String>, query_handler: QueryHandlerSlot, ) -> Result<SocketAddr, String>
Bind and run the follower’s direct gRPC barrier sync server.
§Errors
Returns an error string on bind or socket address retrieval failures.
Sourcepub fn announcement_watch(
&self,
) -> Option<Receiver<Option<BarrierAnnouncement>>>
pub fn announcement_watch( &self, ) -> Option<Receiver<Option<BarrierAnnouncement>>>
Watch over gRPC-delivered announcements, for push-driven waits
(the decision wait and the Aligned resume gate). None until
the gRPC server is started — gossip-KV-only deployments fall
back to polling observe.
Sourcepub async fn observe(
&self,
leader: NodeId,
) -> Result<Option<BarrierAnnouncement>, String>
pub async fn observe( &self, leader: NodeId, ) -> Result<Option<BarrierAnnouncement>, String>
Follower-side observe — returns the latest announcement (non-destructive; repeated calls return the same value until a newer one arrives, matching the gossip-KV fallback). Callers already dedup by epoch/phase. The gRPC-delivered value and the gossip-KV value are merged by epoch (higher wins — epochs are never reused: failed ones are abandoned); within an epoch the gRPC value wins, since RPC arrival order is authoritative while gossip may lag.
§Errors
Returns a string on JSON decode failure.
Sourcepub async fn wait_for_quorum(
&self,
epoch: u64,
expected: &[NodeId],
deadline: Duration,
) -> QuorumOutcome
pub async fn wait_for_quorum( &self, epoch: u64, expected: &[NodeId], deadline: Duration, ) -> QuorumOutcome
Leader-side: wait until quorum or deadline.
Trait Implementations§
Source§impl Debug for BarrierCoordinator
impl Debug for BarrierCoordinator
Source§impl Drop for BarrierCoordinator
impl Drop for BarrierCoordinator
Auto Trait Implementations§
impl !RefUnwindSafe for BarrierCoordinator
impl !UnwindSafe for BarrierCoordinator
impl Freeze for BarrierCoordinator
impl Send for BarrierCoordinator
impl Sync for BarrierCoordinator
impl Unpin for BarrierCoordinator
impl UnsafeUnpin for BarrierCoordinator
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].