Trait int_compute::IntCompute [] [src]

pub trait IntCompute {
    fn event(&mut self, event: &Event, flow_query: &Query);
}

The internal computation itself.

This represents the internal computation. It can hold whatever state (or simply compute the values from the events on the fly) and it processes the events. The updates should be pushed through the channel sender passed during its construction.

Required Methods

Processes a single event.

This is the main callback of the internal computation. It gets called with each event produced and all the computation is expected to take place there.

Params

  • event: The event that happened.
  • flow_query: An interface to query all the existing flows. The computation can use it to access all the flows, but it is not necessary for accessing the flow that originated the event.

The callback doesn't return anything directly. The computation shall push its updates through the sender channel.

Note

You should not update the flow headers directly. Your update might need to be processed by some other internal computations and just modifying the flow headers doesn't trigger it.

Implementors