dataloader v1.0.1 Dataloader.Source protocol

Link to this section Summary

Functions

Fetch the result found under the given batch and item keys

Enqueue an item to be loaded under a given batch

Determine if there are any batches that have not yet been run

Put a value into the results

Run any batches queued up for this source

Link to this section Types

Link to this type batch_key()
batch_key() :: term()
Link to this type item_key()
item_key() :: term()
Link to this type t()
t() :: term()

Link to this section Functions

Link to this function fetch(source, batch_key, item_key)
fetch(t(), batch_key(), item_key()) :: {:ok, term()} | :error

Fetch the result found under the given batch and item keys.

Link to this function load(source, batch_key, item_key)
load(t(), batch_key(), item_key()) :: t()

Enqueue an item to be loaded under a given batch

Link to this function pending_batches?(source)
pending_batches?(t()) :: boolean()

Determine if there are any batches that have not yet been run.

Link to this function put(source, batch_key, item_key, item)
put(t(), batch_key(), item_key(), term()) :: t()

Put a value into the results.

Useful for warming caches. The source is permitted to reject the value.

Link to this function run(source)
run(t()) :: t()

Run any batches queued up for this source.