Trait timely::dataflow::operators::core::exchange::Exchange

source ·
pub trait Exchange<C: Container> {
    // Required method
    fn exchange<F>(&self, route: F) -> Self
       where for<'a> F: FnMut(&C::Item<'a>) -> u64 + 'static;
}
Expand description

Exchange records between workers.

Required Methods§

source

fn exchange<F>(&self, route: F) -> Self
where for<'a> F: FnMut(&C::Item<'a>) -> u64 + 'static,

Exchange records between workers.

The closure supplied should map a reference to a record to a u64, whose value determines to which worker the record will be routed.

§Examples
use timely::dataflow::operators::{ToStream, Exchange, Inspect};

timely::example(|scope| {
    (0..10).to_stream(scope)
           .exchange(|x| *x)
           .inspect(|x| println!("seen: {:?}", x));
});

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<G: Scope, C> Exchange<C> for StreamCore<G, C>
where C: SizableContainer + ExchangeData + ContainerBytes + for<'a> PushInto<C::Item<'a>>,