Event::Emitter::Role::Node - Node.js like event handling
NAME
Event::Emitter::Role::Node - Node.js like event handling
SYNOPSIS
use Event::Emitter::Role::Node;
class Foo does Event::Emitter::Role::Node {
}
my $foo = Foo.new;
$foo.on('message', { say $_ });
$foo.emit('message', 'My Message');
METHODS
The role provides two methods, one to subscribe to events and one to
publish them. They take exactly the same arguments as on
and emit
in
Event::Emitter.