Skip to main content

Probe

Trait Probe 

Source
pub trait Probe<G: Scope, C: Container> {
    // Required methods
    fn probe(self) -> (Handle<G::Timestamp>, Self);
    fn probe_with(self, handle: &Handle<G::Timestamp>) -> Stream<G, C>;
}
Expand description

Monitors progress at a Stream.

Required Methods§

Source

fn probe(self) -> (Handle<G::Timestamp>, Self)

Constructs a progress probe which indicates which timestamps have elapsed at the operator.

Returns a tuple of a probe handle and the input stream.

§Examples
use timely::*;
use timely::dataflow::Scope;
use timely::dataflow::operators::{Input, Probe, Inspect};

// construct and execute a timely dataflow
timely::execute(Config::thread(), |worker| {

    // add an input and base computation off of it
    let (mut input, probe) = worker.dataflow(|scope| {
        let (input, stream) = scope.new_input::<Vec<_>>();
        let (probe, _) = stream.inspect(|x| println!("hello {:?}", x))
                               .probe();
        (input, probe)
    });

    // introduce input, advance computation
    for round in 0..10 {
        input.send(round);
        input.advance_to(round + 1);
        worker.step_while(|| probe.less_than(input.time()));
    }
}).unwrap();
Source

fn probe_with(self, handle: &Handle<G::Timestamp>) -> Stream<G, C>

Inserts a progress probe in a stream.

§Examples
use timely::*;
use timely::dataflow::Scope;
use timely::dataflow::operators::{Input, Probe, Inspect};
use timely::dataflow::operators::probe::Handle;

// construct and execute a timely dataflow
timely::execute(Config::thread(), |worker| {

    // add an input and base computation off of it
    let mut probe = Handle::new();
    let mut input = worker.dataflow(|scope| {
        let (input, stream) = scope.new_input::<Vec<_>>();
        stream.probe_with(&mut probe)
              .inspect(|x| println!("hello {:?}", x));

        input
    });

    // introduce input, advance computation
    for round in 0..10 {
        input.send(round);
        input.advance_to(round + 1);
        worker.step_while(|| probe.less_than(input.time()));
    }
}).unwrap();

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<G: Scope, C: Container> Probe<G, C> for Stream<G, C>