Trait stack_queue::ReducerExt
source · pub trait ReducerExt: Send + Sync + Sized + 'static {
type Task: Send + Sync + Sized + 'static;
type impl_trait_batch_reduce_0<'async_trait, const N: usize, F, R: 'async_trait>: Future<Output = Option<R>> + 'async_trait + Send
where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>,
F: for<'a> FnOnce(UnboundedRange<'a, Self::Task, N>) -> Pin<Box<dyn Future<Output = R> + Send + 'a>> + Send + 'async_trait;
type impl_trait_batch_collect_0<'async_trait, const N: usize>: Future<Output = Option<Vec<Self::Task>>> + 'async_trait + Send
where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>;
// Required methods
fn batch_reduce<'async_trait, const N: usize, F, R: 'async_trait>(
task: Self::Task,
f: F
) -> Self::impl_trait_batch_reduce_0<'async_trait, N, F, R>
where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>,
F: for<'a> FnOnce(UnboundedRange<'a, Self::Task, N>) -> Pin<Box<dyn Future<Output = R> + Send + 'a>> + Send + 'async_trait;
fn batch_collect<'async_trait, const N: usize>(
task: Self::Task
) -> Self::impl_trait_batch_collect_0<'async_trait, N>
where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>;
}
Expand description
Extension trait for types that impl BatchReducer
Required Associated Types§
type Task: Send + Sync + Sized + 'static
type impl_trait_batch_reduce_0<'async_trait, const N: usize, F, R: 'async_trait>: Future<Output = Option<R>> + 'async_trait + Send where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>, F: for<'a> FnOnce(UnboundedRange<'a, Self::Task, N>) -> Pin<Box<dyn Future<Output = R> + Send + 'a>> + Send + 'async_trait
type impl_trait_batch_collect_0<'async_trait, const N: usize>: Future<Output = Option<Vec<Self::Task>>> + 'async_trait + Send where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>
Required Methods§
sourcefn batch_reduce<'async_trait, const N: usize, F, R: 'async_trait>(
task: Self::Task,
f: F
) -> Self::impl_trait_batch_reduce_0<'async_trait, N, F, R>where
Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>,
F: for<'a> FnOnce(UnboundedRange<'a, Self::Task, N>) -> Pin<Box<dyn Future<Output = R> + Send + 'a>> + Send + 'async_trait,
fn batch_reduce<'async_trait, const N: usize, F, R: 'async_trait>( task: Self::Task, f: F ) -> Self::impl_trait_batch_reduce_0<'async_trait, N, F, R>where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>, F: for<'a> FnOnce(UnboundedRange<'a, Self::Task, N>) -> Pin<Box<dyn Future<Output = R> + Send + 'a>> + Send + 'async_trait,
Enqueue and auto-batch task, using reducer fn once per batch
sourcefn batch_collect<'async_trait, const N: usize>(
task: Self::Task
) -> Self::impl_trait_batch_collect_0<'async_trait, N>where
Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>,
fn batch_collect<'async_trait, const N: usize>( task: Self::Task ) -> Self::impl_trait_batch_collect_0<'async_trait, N>where Self: LocalQueue<N, BufferCell = BufferCell<Self::Task>>,
Collect into batches