Skip to main content

Feedback

Trait Feedback 

Source
pub trait Feedback<'scope, T: Timestamp> {
    // Required method
    fn feedback<C: Container>(
        &self,
        summary: <T as Timestamp>::Summary,
    ) -> (Handle<'scope, T, C>, Stream<'scope, T, C>);
}
Expand description

Creates a Stream and a Handle to later bind the source of that Stream.

Required Methods§

Source

fn feedback<C: Container>( &self, summary: <T as Timestamp>::Summary, ) -> (Handle<'scope, T, C>, Stream<'scope, T, C>)

Creates a Stream and a Handle to later bind the source of that Stream.

The resulting Stream will have its data defined by a future call to connect_loop with its Handle passed as an argument. Messages passed through the stream will have the elements of their stamps advanced by summary. Container contents are not inspected or changed; containers whose contents carry times must advance them before the loop.

A message is dropped if its advanced stamp is empty, which includes messages that arrive with empty stamps.

§Examples
use timely::dataflow::Scope;
use timely::dataflow::operators::{Feedback, ConnectLoop, ToStream, Concat, Inspect};
use timely::dataflow::operators::vec::{Map, Filter};

timely::example(|scope| {
    // circulate 0..10, incrementing each, until each reaches 100.
    let (handle, cycle) = scope.feedback(1);
    (0..10).to_stream(scope)
           .container::<Vec<_>>()
           .concat(cycle)
           .inspect(|x| println!("seen: {:?}", x))
           .map(|x| x + 1)
           .filter(|x| *x < 100)
           .connect_loop(handle);
});

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'scope, T: Timestamp> Feedback<'scope, T> for Scope<'scope, T>