Beam::Event - Base Event class
# 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" );
This is the base event class for Beam::Emitter objects.
Beam::Emitter
The base class is only really useful for notifications. Create a subclass to add data attributes.
The name of the event. This is the string that is given to Beam::Emitter::on.
Beam::Emitter::on
The emitter of this event. This is the object that created the event.
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.
To install Beam::Emitter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Beam::Emitter
CPAN shell
perl -MCPAN -e shell install Beam::Emitter
For more information on module installation, please visit the detailed CPAN module installation guide.