Trait timely::dataflow::operators::inspect::Inspect [] [src]

pub trait Inspect<G: Scope, D: Data> {
    fn inspect<F: FnMut(&D) + 'static>(&self, func: F) -> Self;
fn inspect_batch<F: FnMut(&G::Timestamp, &[D]) + 'static>(
        &self,
        func: F
    ) -> Self; }

Methods to inspect records and batches of records on a stream.

Required Methods

Runs a supplied closure on each observed data element.

Examples

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

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

Runs a supplied closure on each observed data batch (time and data slice).

Examples

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

timely::example(|scope| {
    (0..10).to_stream(scope)
           .inspect_batch(|t,xs| println!("seen at: {:?}\t{:?} records", t, xs.len()));
});

Implementors