Skip to main content

load

Function load 

Source
pub async fn load<K, V, T, E, I, D>(
    make_loads: impl FnOnce(BatchSender<K, V>) -> I,
    dispatch: impl FnMut(Vec<K>, Vec<Sender<V>>) -> D,
    on_loaded: impl FnMut(T),
) -> Result<(), E>
where I: ExactSizeIterator, I::Item: Future<Output = Result<T, E>>, D: Future<Output = ()>,
Expand description

Drives one caller’s per-key loads and batches requests from their active initializers. Each dispatch receives ready keys and their corresponding reply senders in the same order. Completed loads are delivered to on_loaded in completion order. An error or cancellation drops the remaining loads and any in-progress dispatch.