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

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

Exchange records between workers.

Required Methods

Exchange records so that all records with the same route are at the same worker.

Examples

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

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

Exchange records by time so that all records whose time and data evaluate to the same route are at the same worker.

Examples

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

timely::example(|scope| {
    (0..10).to_stream(scope)
           .exchange_ts(|&t, &x| t.inner & 1 ^ x)
           .inspect(|x| println!("seen: {:?}", x));
});

Implementors