Data-Chronicle
view release on metacpan or search on metacpan
106107108109110111112113114115116117118119120121122123124125126"subscribe"
in Data::Chronicle::Subscriber
Given a category, name, and callback assigns the callback to be called
when
a new value is set
for
the specified category and name (
if
the
writer
has
publish_on_set enabled).
$subscriber
->subscribe(
"category1"
,
"name2"
,
sub
{
'Hello World'
});
"unsubscribe"
in Data::Chronicle::Subscriber
Given a category, name, clears the callbacks associated
with
the
specified category and name.
$subscriber
->unsubscribe(
"category1"
,
"name2"
);
EXAMPLES
my
$d
= get_some_log_data();
my
$chronicle_w
= Data::Chronicle::Writer->new(
cache_writer
=>
$writer
,
lib/Data/Chronicle.pm view on Meta::CPAN
8990919293949596979899100101102103104105106107108109
my
$some_old_data
=
$reader
->get_for(
"category1"
,
"name2"
, 2);
=head2 L<Data::Chronicle::Subscriber/subscribe>
Given a category, name, and callback assigns the callback to be called when a new value is set for the specified category and name (if the writer has publish_on_set enabled).
$subscriber->subscribe("category1", "name2", sub { print 'Hello World' });
=head2 L<Data::Chronicle::Subscriber/unsubscribe>
Given a category, name, clears the callbacks associated with the specified category and name.
$subscriber->unsubscribe("category1", "name2");
=head1 EXAMPLES
my $d = get_some_log_data();
my $chronicle_w = Data::Chronicle::Writer->new(
cache_writer => $writer,
dbic => $dbic);
( run in 0.282 second using v1.01-cache-2.11-cpan-ec4f86ec37b )