Help for this page

Select Code to Download


  1. or download this
    use Net::ZooKeeper qw(:node_flags :acls);
    my $zkh = Net::ZooKeeper->new('localhost:7000');
    $zkh->create('/myzknode, 'active', 'flags' => ZOO_EPHEMERAL, 'acl' => 
    +ZOO_OPEN_ACL_UNSAFE) or die("unable to create node /myzknode: " . $zk
    +h->get_error() . "\n");
    print "node /myzknode has value: " . $zkh->get('/myzknode') . "\n";
    
  2. or download this
    my $watch = $zkh->watch('timeout' => 10000);
      $zkh->exists('/myzknode', 'watch' => $watch);
    ...
      else {
        print "watch timed out after 10 seconds\n";
      }