pub enum CapacityPolicy {
RejectIncoming,
OverwriteOldest,
}Expand description
Policy for handling new appends when the WAL is at capacity.
RejectIncoming propagates backpressure. For a transient source (e.g.,
HTTP webhook), this typically means returning 503 to the external producer,
which should retry. This preserves data safety but will cause the source to
appear “stuck” if the producer stops retrying or the consumer is permanently
stalled.
OverwriteOldest favors availability — keeps accepting new events by
evicting the oldest. Slow consumers may see gaps and trigger their recovery
policy. Choose this when availability matters more than no-loss replay.
Sources should choose based on their backpressure contract with upstream producers.
Variants§
RejectIncoming
Reject the incoming event with WalError::CapacityExhausted.
OverwriteOldest
Evict the oldest event(s) to make room for the new one.
Trait Implementations§
Source§impl Clone for CapacityPolicy
impl Clone for CapacityPolicy
Source§fn clone(&self) -> CapacityPolicy
fn clone(&self) -> CapacityPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CapacityPolicy
impl Debug for CapacityPolicy
Source§impl PartialEq for CapacityPolicy
impl PartialEq for CapacityPolicy
Source§fn eq(&self, other: &CapacityPolicy) -> bool
fn eq(&self, other: &CapacityPolicy) -> bool
self and other values to be equal, and is used by ==.impl Copy for CapacityPolicy
impl Eq for CapacityPolicy
impl StructuralPartialEq for CapacityPolicy
Auto Trait Implementations§
impl Freeze for CapacityPolicy
impl RefUnwindSafe for CapacityPolicy
impl Send for CapacityPolicy
impl Sync for CapacityPolicy
impl Unpin for CapacityPolicy
impl UnsafeUnpin for CapacityPolicy
impl UnwindSafe for CapacityPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.