pub trait BatchReducer: Send + Sync + Sized + 'static {
    type Task: Send + Sync + Sized + 'static;
}
Expand description

Auto-batched queue whereby tasks are reduced or collected

Example

struct Accumulator;

#[local_queue]
impl BatchReducer for Accumulator {
  type Task = usize;
}

let sum: Option<usize> = Accumulator::batch_reduce(9000, |batch| batch.sum::<usize>()).await;

Required Associated Types§

source

type Task: Send + Sync + Sized + 'static

Implementors§