[−][src]Trait timely::dataflow::operators::inspect::Inspect
Methods to inspect records and batches of records on a stream.
Required methods
fn inspect_batch(
&self,
func: impl FnMut(&G::Timestamp, &[D]) + 'static
) -> Stream<G, D>
&self,
func: impl FnMut(&G::Timestamp, &[D]) + 'static
) -> Stream<G, D>
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())); });
Provided methods
fn inspect(&self, func: impl FnMut(&D) + 'static) -> Stream<G, D>
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)); });
fn inspect_time(
&self,
func: impl FnMut(&G::Timestamp, &D) + 'static
) -> Stream<G, D>
&self,
func: impl FnMut(&G::Timestamp, &D) + 'static
) -> Stream<G, D>
Runs a supplied closure on each observed data element and associated time.
Examples
use timely::dataflow::operators::{ToStream, Map, Inspect}; timely::example(|scope| { (0..10).to_stream(scope) .inspect_time(|t, x| println!("seen at: {:?}\t{:?}", t, x)); });