NAME

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

VERSION

This document describes Data::EventStream::Window version 0.07

DESCRIPTION

This class represents time window for which aggregator aggregates data. Normally window objects are passed to aggregators' callbacks and user has no need to build them himself.

METHODS

$self->shift

Shift parameter for count aggregators, by default 0.

$self->count

Number of events in the window

$self->start_time

Window start time

$self->end_time

Window end time

$self->time_length

Window length in time

$self->get_event($idx)

Returns event with the specified index. 0 being the latest, most recent event, and -1 being the oldest event.

$self->get_iterator

Returns callable iterator object. Each time you call it, it returns the next event starting from the latest one. For example:

my $next_event = $win->get_iterator;
while ( my $event = $next_event->() ) {
    ...
}