Crate ultra_batch
source · [−]Expand description
Batch and cache database queries or other potentially expensive data lookups. The main motivation for this library is to solve the “N + 1” query problem seen in GraphQL and elsewhere. This library takes heavy influence from the GraphQL Foundation’s DataLoader.
The most common entrypoints to this library are the Batcher
type (used
to queue and load data in batches) and the Fetcher
trait (used by
Batcher
s to actually retrieve the data).
Structs
Used to batch and cache loads from some datastore. A Batcher
can be used
with any type that implements Fetcher
. Batcher
s are asynchronous, and
designed to be passed and shared between threads or tasks. Cloning a
Batcher
is shallow and can be used to use the same Fetcher
across
multiple threads or tasks.
Used to configure a new Batcher
. A BatcherBuilder
is returned from
Batcher::build
.