Struct ultra_batch::BatcherBuilder
source · [−]Expand description
Used to configure a new Batcher
. A BatcherBuilder
is returned from
Batcher::build
.
Implementations
sourceimpl<F> BatcherBuilder<F> where
F: Fetcher + Send + Sync + 'static,
impl<F> BatcherBuilder<F> where
F: Fetcher + Send + Sync + 'static,
sourcepub fn delay_duration(self, delay: Duration) -> Self
pub fn delay_duration(self, delay: Duration) -> Self
sourcepub fn eager_batch_size(self, eager_batch_size: Option<usize>) -> Self
pub fn eager_batch_size(self, eager_batch_size: Option<usize>) -> Self
The maximum number of keys to wait for before eagerly calling the
Fetcher
. A value of Some(n)
will load the batch once n
or more
keys have been queued (or once the timeout set by
delay_duration
is reached, whichever
comes first). A value of None
will never eagerly dispatch the queue,
and the Batcher
will always wait for the timeout set by
delay_duration
.
Note that eager_batch_size
does not set an upper limit on the
batch! For example, if Batcher::load_many
is called with more than
eager_batch_size
items, then the batch will be sent immediately with
all of the provided keys.
Auto Trait Implementations
impl<F> RefUnwindSafe for BatcherBuilder<F> where
F: RefUnwindSafe,
impl<F> Send for BatcherBuilder<F>
impl<F> Sync for BatcherBuilder<F>
impl<F> Unpin for BatcherBuilder<F> where
F: Unpin,
impl<F> UnwindSafe for BatcherBuilder<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more