Trait timely::dataflow::operators::feedback::LoopVariable
[−]
[src]
pub trait LoopVariable<G: Scope, T: Timestamp> { fn loop_variable<D: Data>(&mut self, limit: T, summary: T::Summary) -> (Handle<G::Timestamp, T, D>, Stream<Child<G, T>, D>); }
Creates a Stream
and a Handle
to later bind the source of that Stream
.
Required Methods
fn loop_variable<D: Data>(&mut self, limit: T, summary: T::Summary) -> (Handle<G::Timestamp, T, D>, Stream<Child<G, T>, 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 collect_loop
with
its Handle
passed as an argument. Data will be passed through the stream will have their
timestampsas advanced by summary
, and will be dropped if the result exceeds limit
.
Examples
use timely::dataflow::operators::{LoopVariable, ConnectLoop, ToStream, Concat, Inspect}; timely::example(|scope| { // circulate 0..10 for 100 iterations. let (handle, cycle) = scope.loop_variable(100, 1); (0..10).to_stream(scope) .concat(&cycle) .inspect(|x| println!("seen: {:?}", x)) .connect_loop(handle); });