pub struct CheckpointCoordinator { /* private fields */ }Expand description
Coordinates checkpoints across multiple contexts.
Sends CheckpointBarrier to all contexts, collects CheckpointAck responses,
and persists the assembled Checkpoint once all contexts have acknowledged.
Implementations§
Source§impl CheckpointCoordinator
impl CheckpointCoordinator
Sourcepub fn new(manager: CheckpointManager, context_names: Vec<String>) -> Self
pub fn new(manager: CheckpointManager, context_names: Vec<String>) -> Self
Create a new coordinator for the given contexts.
Sourcepub fn ack_sender(&self) -> Sender<CheckpointAck>
pub fn ack_sender(&self) -> Sender<CheckpointAck>
Get a sender for checkpoint acknowledgments (cloned into each context).
Sourcepub fn initiate(
&mut self,
context_txs: &FxHashMap<String, Sender<ContextMessage>>,
)
pub fn initiate( &mut self, context_txs: &FxHashMap<String, Sender<ContextMessage>>, )
Initiate a new checkpoint by sending barriers to all contexts.
Sourcepub fn receive_ack(&mut self, ack: CheckpointAck) -> Option<Checkpoint>
pub fn receive_ack(&mut self, ack: CheckpointAck) -> Option<Checkpoint>
Receive an acknowledgment. Returns a complete Checkpoint when all contexts have acked.
Sourcepub fn try_complete(&mut self) -> Result<(), StoreError>
pub fn try_complete(&mut self) -> Result<(), StoreError>
Try to drain pending acks and complete the checkpoint.
Sourcepub fn should_checkpoint(&self) -> bool
pub fn should_checkpoint(&self) -> bool
Check if a checkpoint should be initiated based on interval.
Sourcepub const fn has_pending(&self) -> bool
pub const fn has_pending(&self) -> bool
Whether a checkpoint is currently in progress (waiting for acks).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CheckpointCoordinator
impl !RefUnwindSafe for CheckpointCoordinator
impl Send for CheckpointCoordinator
impl Sync for CheckpointCoordinator
impl Unpin for CheckpointCoordinator
impl UnsafeUnpin for CheckpointCoordinator
impl !UnwindSafe for CheckpointCoordinator
Blanket Implementations§
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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