pub struct BatcherBuilder<F> where
    F: Fetcher + Send + Sync + 'static, 
{ /* private fields */ }
Expand description

Used to configure a new Batcher. A BatcherBuilder is returned from Batcher::build.

Implementations

The maximum amount of time the Batcher will wait to queue up more keys before calling the Fetcher.

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.

Set a label for the Batcher. This is only used to improve diagnostic messages, such as logs.

Create and return a Batcher with the given options.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more