NAME
Pcore::Core::Event - Pcore event broker
SYNOPSIS
P->listen_events(
[ 'TEST1', 'TEST2.*.LOG', 'TEST3.#' ], # listen masks
sub ( $ev ) { # callback
say dump $ev->{key};
say dump $ev->{data};
return;
},
'stderr:', # pipe
[ 'stderr:', tmpl => "<: \$key :>$LF<: \$text :>" ], # pipe with params
[ 'file:123.log', tmpl => "<: \$key :>$LF<: \$text :>" ], # pipe with params
);
P->fire_event( 'TEST.1234.AAA', $data );
DESCRIPTION
ATTRIBUTES
METHODS
fire_event( $key, $data ) - fire event
$key - event key, special symbols can be used:
* (star) can substitute for exactly one word;
# (hash) can substitute for zero or more words;
where word is /[^.]/