timely::dataflow::operators::generic

Type Alias FrontieredInputHandle

Source
pub type FrontieredInputHandle<'a, T, D, P> = FrontieredInputHandleCore<'a, T, Vec<D>, P>;
Expand description

Handle to an operator’s input stream and frontier, specialized to vectors.

Aliased Type§

struct FrontieredInputHandle<'a, T, D, P> {
    pub handle: &'a mut InputHandleCore<T, Vec<D>, P>,
    pub frontier: &'a MutableAntichain<T>,
}

Fields§

§handle: &'a mut InputHandleCore<T, Vec<D>, P>

The underlying input handle.

§frontier: &'a MutableAntichain<T>

The frontier as reported by timely progress tracking.

Implementations

Source§

impl<'a, T: Timestamp, C: Container, P: Pull<Message<T, C>> + 'a> FrontieredInputHandleCore<'a, T, C, P>

Source

pub fn new( handle: &'a mut InputHandleCore<T, C, P>, frontier: &'a MutableAntichain<T>, ) -> Self

Allocate a new frontiered input handle.

Source

pub fn next(&mut self) -> Option<(InputCapability<T>, &mut C)>

Reads the next input buffer (at some timestamp t) and a corresponding capability for t. The timestamp t of the input buffer can be retrieved by invoking .time() on the capability. Returns None when there’s no more data available.

Source

pub fn for_each<F: FnMut(InputCapability<T>, &mut C)>(&mut self, logic: F)

Repeatedly calls logic till exhaustion of the available input data. logic receives a capability and an input buffer.

§Examples
use timely::dataflow::operators::ToStream;
use timely::dataflow::operators::generic::Operator;
use timely::dataflow::channels::pact::Pipeline;

timely::example(|scope| {
    (0..10).to_stream(scope)
           .unary(Pipeline, "example", |_cap,_info| |input, output| {
               input.for_each(|cap, data| {
                   output.session(&cap).give_container(data);
               });
           });
});
Source

pub fn frontier(&self) -> &'a MutableAntichain<T>

Inspect the frontier associated with this input.