The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ZooKeeper::Watcher

DESCRIPTION

A perl class for constructing the watcher contexts passed to the ZooKeeper C library.

ATTRIBUTES

dispatcher

A weak reference to the dispatcher the watcher belongs to. Needed in order for the watcher to notify the dispatcher when it has been triggered.

cb

A perl subroutine reference. Invoked with an event hashref, when the watch is triggered by the ZooKeeper C library.

    sub {
        my ($event) = @_;
        my $path  = $event->{path};
        my $type  = $event->{type};
        my $state = $event->{state};
    }