Skip to main content

FollowerSyncClient

Struct FollowerSyncClient 

Source
pub struct FollowerSyncClient { /* private fields */ }
Expand description

Pushes leader events to a follower over transport.

Implementations§

Source§

impl FollowerSyncClient

Source

pub fn new(transport: HttpSyncTransport) -> Self

Creates a follower client with bounded in-memory buffering and default retries.

Source

pub fn with_retry_policy(self, retry_policy: SyncRetryPolicy) -> Self

Replaces retry, backoff, and queue limits.

Source

pub fn retry_policy(&self) -> SyncRetryPolicy

Returns the configured retry policy.

Source

pub fn with_outbox(self, outbox: Arc<dyn SyncOutbox>) -> Self

Replaces the pending-message outbox implementation.

Source

pub fn with_file_outbox(self, file_path: impl Into<PathBuf>) -> SyncResult<Self>

Configures a durable file outbox at file_path.

Source

pub fn metrics(&self) -> SyncPushMetrics

Returns a snapshot of cumulative push counters.

Source

pub fn pending_len(&self) -> usize

Returns the pending count, or zero if the outbox cannot be read.

Source

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.

Source

pub fn pending_page( &self, limit: usize, max_bytes: usize, ) -> SyncResult<Vec<SyncMessage>>

Returns one pending page bounded before payload clones.

Source

pub fn outbox_stats(&self) -> SyncResult<SyncOutboxStats>

Returns payload-free outbox observations.

Source

pub fn cancel(&self)

Cancels active transport I/O and retry waits.

Source

pub fn is_cancelled(&self) -> bool

Reports whether this client has been cancelled.

Source

pub fn flush_pending(&self) -> SyncResult<()>

Attempts delivery of all currently queued batches.

Source

pub fn flush_pending_with_progress(&self) -> SyncResult<Option<SyncMessage>>

Attempts queued delivery and returns the last batch durably acknowledged.

Source

pub fn push_events(&self, message: &SyncMessage) -> SyncResult<()>

Enqueues a batch durably before attempting ordered delivery.

Trait Implementations§

Source§

impl Clone for FollowerSyncClient

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for FollowerSyncClient

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.