use timely::dataflow::{InputHandle, ProbeHandle};
use timely::dataflow::operators::{Inspect, Probe};
use timely::WorkerConfig;
fn main() {
let allocator = timely::communication::Allocator::Thread(
timely::communication::allocator::Thread::default(),
);
let mut worker = timely::worker::Worker::new(WorkerConfig::default(), allocator, None);
let mut input = InputHandle::new();
let probe = ProbeHandle::new();
worker.dataflow(|scope| {
input
.to_stream(scope)
.container::<Vec<_>>()
.inspect(|x| println!("{:?}", x))
.probe_with(&probe);
});
for i in 0 .. 10 {
input.send(i);
input.advance_to(i);
while probe.less_than(input.time()) {
worker.step();
}
}
}