ZooKeeper::Transaction
my $txn = $zk->transaction ->delete( '/some-node' ) ->create( '/another-node' ) my ($delete_result, $create_result) = $txn->commit;
A ZooKeeper::Transaction is used for constructing a set of multiple operations, which must be committed atomically.
When any of the operations fail, all ops in the transaction will return hash refs with 'type' set to 'error', and with 'code' set to the error code for the operation.
Commit a transaction. Returns a list of op results.
$txn->create($path, %extra) REQUIRED $path OPTIONAL %extra acl buffer_length ephemeral sequential value
Return a tranaction with a create op code.
On commit this will return a hash ref with type 'create', and with 'path' set to the path to the new node.
$txn->delete($path, %extra) REQUIRED $path OPTIONAL %extra version
Return a tranaction with a delete op code.
On commit this will return a hash ref with type 'delete'.
$txn->set($path, $value, %extra) REQUIRED $path REQUIRED $value OPTIONAL %extra version
Return a tranaction with a set op code.
On commit this will return a hash ref with type 'set', and with 'stat' set a stat hash ref of the updated node.
$txn->check($path, $version) REQUIRED $path REQUIRED $version
Return a tranaction with a check op code.
On commit this will return a hash ref with type 'check'.
To install ZooKeeper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZooKeeper
CPAN shell
perl -MCPAN -e shell install ZooKeeper
For more information on module installation, please visit the detailed CPAN module installation guide.