NAME

Pcore::Core::Event - Pcore event broker

SYNOPSIS

P->on(
    [ 'test1', 'test2.*.log', 'test3.#' ],                       # bindings
    sub ( $ev ) {                                                # callback
        say dump $ev->{key};
        say dump $ev->{data};

        return;
    },
);

P->on( 'log.test.*', 'stderr:' );                                                   # pipe
P->on( 'log.test.*', [ 'stderr:',      tmpl => "<: \$key :>\n<: \$text :>" ] );    # pipe with params
P->on( 'log.test.*', [ 'file:123.log', tmpl => "<: \$key :>\n<: \$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 /[^.]/

SEE ALSO