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

NAME

Beam::Event - Base Event class

SYNOPSIS

    # My::Emitter consumes the Beam::Emitter role
    my $emitter = My::Emitter->new;
    $emitter->on( "foo", sub {
        my ( $event ) = @_;
        print "Foo happened!\n";
        # stop this event from continuing
        $event->stop;
    } );
    my $event = $emitter->emit( "foo" );

DESCRIPTION

This is the base event class for Beam::Emitter objects.

The base class is only really useful for notifications. Create a subclass to add data attributes.

ATTRIBUTES

name

The name of the event. This is the string that is given to Beam::Emitter::on.

emitter

The emitter of this event. This is the object that created the event.

METHODS

stop ()

Calling this will immediately stop any further processing of this event. Also calls stop_default().

stop_default ()

Calling this will cause the default behavior of this event to be stopped.