NAME
MooX::Role::EventEmitter - Event emitter role
SYNOPSIS
METHODS
$obj->emit $name, @args
Emit an event
$obj->has_subscribers $name
Check if an event has subscribers.
$obj->on $name, @args
my
$cb
=
$obj
->on(
myevent
=>
sub
{ ... });
Subscribe to an event.
$obj->once $name, @args
my
$cb
=
$obj
->once(
myevent
=>
sub
{ ... });
Subscribe to an event for just one event.
$obj->subscribers( $name )
my
$s
=
$obj
->subscribers(
'myevent'
);
Return an arrayref of the subscribers for an event.
$obj->unsubscribe( $name => $cb )
$obj
->unsubscribe(
'myevent'
,
$cb
);
# a specific callback
$obj
->unsubscribe(
'myevent'
);
# all callbacks
Unsubscribe from event.
SEE ALSO
Mojo::EventEmitter - the module this API is based on