pub struct Builder<S> { /* private fields */ }Expand description
Builds a queue over a Store.
Implementations§
Source§impl<S: Store> Builder<S>
impl<S: Store> Builder<S>
Sourcepub fn new(store: S) -> Self
pub fn new(store: S) -> Self
Start a builder over store (1024 items, unbounded bytes, Durability::Sync).
Sourcepub fn capacity(self, capacity: usize) -> Self
pub fn capacity(self, capacity: usize) -> Self
Set the maximum number of unacked items before push blocks. Must be > 0.
Sourcepub fn max_bytes(self, max_bytes: usize) -> Self
pub fn max_bytes(self, max_bytes: usize) -> Self
Also bound the queue by the total bytes of unacked items (default:
unbounded). push blocks when either this or the item-count
capacity would be exceeded. An item larger than
max_bytes is still admitted into an empty queue, so one large item cannot
deadlock. Must be > 0.
Sourcepub fn durability(self, durability: Durability) -> Self
pub fn durability(self, durability: Durability) -> Self
Set the durability policy.
Sourcepub fn durable_acks(self, durable_acks: bool) -> Self
pub fn durable_acks(self, durable_acks: bool) -> Self
Set whether acks are made durable (fsync’d). Defaults to true.
At-least-once delivery does not need the ack itself to be durable: if an ack
is lost to a crash, the item is simply redelivered. Setting this to false
skips the ack fsync - roughly halving the per-message fsync cost under
Durability::Sync - in exchange for redelivering the items whose acks had
not reached disk when the process crashed. It never weakens the delivery
guarantee, and has no effect under Durability::None (nothing fsyncs).