Data-Chronicle
view release on metacpan or search on metacpan
"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 { print '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
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.231 second using v1.01-cache-2.11-cpan-ec4f86ec37b )