timely::dataflow::operators::generic

Type Alias OutputHandle

Source
pub type OutputHandle<'a, T, D, P> = OutputHandleCore<'a, T, CapacityContainerBuilder<Vec<D>>, P>;
Expand description

Handle specialized to Vec-based container.

Aliased Type§

struct OutputHandle<'a, T, D, P> { /* private fields */ }

Implementations

Source§

impl<'a, T: Timestamp, CB: ContainerBuilder, P: Push<Message<T, CB::Container>>> OutputHandleCore<'a, T, CB, P>

Source

pub fn session_with_builder<'b, CT: CapabilityTrait<T>>( &'b mut self, cap: &'b CT, ) -> Session<'b, T, CB, PushCounter<T, CB::Container, P>>
where 'a: 'b,

Obtains a session that can send data at the timestamp associated with capability cap.

In order to send data at a future timestamp, obtain a capability for the new timestamp first, as show in the example.

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

timely::example(|scope| {
    (0..10).to_stream(scope)
           .unary::<CapacityContainerBuilder<_>, _, _, _>(Pipeline, "example", |_cap, _info| |input, output| {
               input.for_each(|cap, data| {
                   let time = cap.time().clone() + 1;
                   output.session_with_builder(&cap.delayed(&time))
                         .give_container(data);
               });
           });
});
Source

pub fn cease(&mut self)

Flushes all pending data and indicate that no more data immediately follows.

Source§

impl<'a, T: Timestamp, C: Container + Data, P: Push<Message<T, C>>> OutputHandleCore<'a, T, CapacityContainerBuilder<C>, P>

Source

pub fn session<'b, CT: CapabilityTrait<T>>( &'b mut self, cap: &'b CT, ) -> Session<'b, T, CapacityContainerBuilder<C>, PushCounter<T, C, P>>
where 'a: 'b,

Obtains a session that can send data at the timestamp associated with capability cap.

In order to send data at a future timestamp, obtain a capability for the new timestamp first, as show in the example.

§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| {
                   let time = cap.time().clone() + 1;
                   output.session(&cap.delayed(&time))
                         .give_container(data);
               });
           });
});

Trait Implementations

Source§

impl<T: Timestamp, CB: ContainerBuilder, P: Push<Message<T, CB::Container>>> Drop for OutputHandleCore<'_, T, CB, P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more