Trait timely::dataflow::operators::exchange::Exchange[][src]

pub trait Exchange<T, D: ExchangeData> {
    fn exchange(&self, route: impl Fn(&D) -> u64 + 'static) -> Self;
}

Exchange records between workers.

Required methods

fn exchange(&self, route: impl Fn(&D) -> u64 + 'static) -> Self[src]

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));
});
Loading content...

Implementors

impl<G: Scope, D: ExchangeData> Exchange<<G as ScopeParent>::Timestamp, D> for Stream<G, D>[src]

Loading content...