NAME

Data::EventStream::Aggregator - Perl extension for event processing

VERSION

This document describes Data::EventStream::Aggregator version 0.13

DESCRIPTION

This role defines interface that should be implemented by any aggregator used with Data::EventStream. Aggregator does not have to be Moose class and literally use this role, but it should implement the methods described.

METHODS

$self->enter($event, $window)

This method is invoked when a new event enters aggregator's window. Window object already includes the new event.

$self->leave($event, $window)

This method is invoked when an event leaves aggregator's window. Window object already excludes the leaving event.

$self->reset($window)

This method is invoked when aggregator is used in the batch mode, each time after it finished processing another batch. Window object already empty and doesn't have any events.

$self->window_update($window)

This method is invoked when time changes and window contains new time limits. Note, that when window's time limits are changed this method is guaranteed to be invoked, subsequent enter and leave invocations will have the same start_time, end_time, and time_length as during the last window_update invocation.