pub trait Feedback<G: Scope> {
    // Required methods
    fn feedback<D: Data>(
        &mut self,
        summary: <G::Timestamp as Timestamp>::Summary
    ) -> (Handle<G, D>, Stream<G, D>);
    fn feedback_core<D: Container>(
        &mut self,
        summary: <G::Timestamp as Timestamp>::Summary
    ) -> (HandleCore<G, D>, StreamCore<G, D>);
}
Expand description

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

Required Methods§

source

fn feedback<D: Data>( &mut self, summary: <G::Timestamp as Timestamp>::Summary ) -> (Handle<G, D>, Stream<G, D>)

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. Data passed through the stream will have their timestamps advanced by summary.

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

timely::example(|scope| {
    // circulate 0..10 for 100 iterations.
    let (handle, cycle) = scope.feedback(1);
    (0..10).to_stream(scope)
           .concat(&cycle)
           .inspect(|x| println!("seen: {:?}", x))
           .branch_when(|t| t < &100).1
           .connect_loop(handle);
});
source

fn feedback_core<D: Container>( &mut self, summary: <G::Timestamp as Timestamp>::Summary ) -> (HandleCore<G, D>, StreamCore<G, D>)

Creates a StreamCore and a HandleCore 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. Data passed through the stream will have their timestamps advanced by summary, and will be dropped if the result exceeds limit.

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

timely::example(|scope| {
    // circulate 0..10 for 100 iterations.
    let (handle, cycle) = scope.feedback_core::<Vec<_>>(1);
    (0..10).to_stream(scope)
           .concat(&cycle)
           .inspect(|x| println!("seen: {:?}", x))
           .branch_when(|t| t < &100).1
           .connect_loop(handle);
});

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<G: Scope> Feedback<G> for G