The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

EventStore::Tiny::Event

REFERENCE

EventStore::Tiny::Event implements the following attributes and methods.

ATTRIBUTES

All these attributes can be manipulated by setters/getters with the attribute's name or can be set on construction:

    my $event = EventStore::Tiny::Event->new(
        name        => 'Foo',
        trans_store => $ts,
        data        => {id => 42},
    );

uuid

This event's UUID. By default a new UUID is created.

timestamp

This event's timestamp. By default a new timestamp of the creation time is set.

name

This event's name. Setting this attribute on construction is required.

trans_store

The EventStore::Tiny::TransformationStore object where this event's transformation subroutine will be looked up on application.

data

Concrete data for this event which will be used during application.

METHODS

transformation

    $event->transformation->($state);

Returns the transformation subroutine as a coderef for this event.

apply_to

    $event->apply_to(\%state, $logger);

Applies this event's transformation to the given state (by side-effect). If a $logger as a subref is given, it is used to log this application.

summary

    say $event->summary;

Returns a one-line summarized stringification of this event.

SEE ALSO

EventStore::Tiny

COPYRIGHT AND LICENSE

Copyright (c) 2018 Mirko Westermeier (mail: mirko@westermeier.de)

Released under the MIT License (see LICENSE.txt for details).