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 a complete compatibility snapshot of pending batches.
New consumers should use Self::pending_page and Self::outbox_stats
so queue growth cannot determine one allocation.
Sourcepub fn pending_page(
&self,
limit: usize,
max_bytes: usize,
) -> SyncResult<Vec<SyncMessage>>
pub fn pending_page( &self, limit: usize, max_bytes: usize, ) -> SyncResult<Vec<SyncMessage>>
Returns one pending page bounded before payload clones.
Sourcepub fn outbox_stats(&self) -> SyncResult<SyncOutboxStats>
pub fn outbox_stats(&self) -> SyncResult<SyncOutboxStats>
Returns payload-free outbox observations.
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 flush_pending_with_progress(&self) -> SyncResult<Option<SyncMessage>>
pub fn flush_pending_with_progress(&self) -> SyncResult<Option<SyncMessage>>
Attempts queued delivery and returns the last batch durably acknowledged.
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
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more