pub struct FollowerSyncClient { /* private fields */ }Expand description
Pushes leader events to a follower over transport.
Implementations§
Source§impl FollowerSyncClient
impl FollowerSyncClient
Sourcepub fn new(transport: HttpSyncTransport) -> Self
pub fn new(transport: HttpSyncTransport) -> Self
Creates a follower client with bounded in-memory buffering and default retries.
Sourcepub fn with_retry_policy(self, retry_policy: SyncRetryPolicy) -> Self
pub fn with_retry_policy(self, retry_policy: SyncRetryPolicy) -> Self
Replaces retry, backoff, and queue limits.
Sourcepub fn retry_policy(&self) -> SyncRetryPolicy
pub fn retry_policy(&self) -> SyncRetryPolicy
Returns the configured retry policy.
Sourcepub fn with_outbox(self, outbox: Arc<dyn SyncOutbox>) -> Self
pub fn with_outbox(self, outbox: Arc<dyn SyncOutbox>) -> Self
Replaces the pending-message outbox implementation.
Sourcepub fn with_file_outbox(self, file_path: impl Into<PathBuf>) -> SyncResult<Self>
pub fn with_file_outbox(self, file_path: impl Into<PathBuf>) -> SyncResult<Self>
Configures a durable file outbox at file_path.
Sourcepub fn metrics(&self) -> SyncPushMetrics
pub fn metrics(&self) -> SyncPushMetrics
Returns a snapshot of cumulative push counters.
Sourcepub fn pending_len(&self) -> usize
pub fn pending_len(&self) -> usize
Returns the pending count, or zero if the outbox cannot be read.
Sourcepub fn pending_messages(&self) -> SyncResult<Vec<SyncMessage>>
pub fn pending_messages(&self) -> SyncResult<Vec<SyncMessage>>
Returns pending batches in delivery order.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Reports whether this client has been cancelled.
Sourcepub fn flush_pending(&self) -> SyncResult<()>
pub fn flush_pending(&self) -> SyncResult<()>
Attempts delivery of all currently queued batches.
Sourcepub fn push_events(&self, message: &SyncMessage) -> SyncResult<()>
pub fn push_events(&self, message: &SyncMessage) -> SyncResult<()>
Enqueues a batch durably before attempting ordered delivery.
Trait Implementations§
Source§impl Clone for FollowerSyncClient
impl Clone for FollowerSyncClient
Source§fn clone(&self) -> FollowerSyncClient
fn clone(&self) -> FollowerSyncClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FollowerSyncClient
impl !UnwindSafe for FollowerSyncClient
impl Freeze for FollowerSyncClient
impl Send for FollowerSyncClient
impl Sync for FollowerSyncClient
impl Unpin for FollowerSyncClient
impl UnsafeUnpin for FollowerSyncClient
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