Trait Distributor

Source
pub trait Distributor<C> {
    // Required methods
    fn partition<T: Clone, P: Push<Message<T, C>>>(
        &mut self,
        container: &mut C,
        time: &T,
        pushers: &mut [P],
    );
    fn flush<T: Clone, P: Push<Message<T, C>>>(
        &mut self,
        time: &T,
        pushers: &mut [P],
    );
    fn relax(&mut self);
}
Expand description

Distribute containers to several pushers.

A distributor sits behind an exchange pusher, and partitions containers at a given time into several pushers. It can use Message::push_at to push its outputs at the desired pusher.

It needs to uphold progress tracking requirements. The count of the input container must be preserved across the output containers, from the first call to partition until the call to flush for a specific time stamp.

Required Methods§

Source

fn partition<T: Clone, P: Push<Message<T, C>>>( &mut self, container: &mut C, time: &T, pushers: &mut [P], )

Partition the contents of container at time into the pushers.

Source

fn flush<T: Clone, P: Push<Message<T, C>>>( &mut self, time: &T, pushers: &mut [P], )

Flush any remaining contents into the pushers at time time.

Source

fn relax(&mut self)

Optionally release resources, such as memory.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<CB, H> Distributor<<CB as ContainerBuilder>::Container> for DrainContainerDistributor<CB, H>
where CB: ContainerBuilder<Container: DrainContainer> + for<'a> PushInto<<CB::Container as DrainContainer>::Item<'a>>, for<'a> H: FnMut(&<CB::Container as DrainContainer>::Item<'a>) -> u64,