Class: AsyncTransaction

AsyncTransaction

An asynchronous zookeeper transaction. Created by AsyncClient.transaction()

Constructor

new AsyncTransaction()

Source:

Methods

check(path, version) → {AsyncTransaction}

Add a check (existence) operation with given path and optional version.
Parameters:
Name Type Description
path * Path of the node.
version * The version of the node, optional, defaults to -1.
Source:
Returns:
Type
AsyncTransaction

commit(cb)

Execute the transaction atomically.
Parameters:
Name Type Description
cb function The callback function.
Source:

commitAsync() → {Promise}

Execute the transaction atomically. Resolves when the operation has completed, rejects if anything goes wrong.
Source:
Returns:
Type
Promise

create(path, data, acls, mode) → {AsyncTransaction}

Add a create operation with given path, data, acls and mode.
Parameters:
Name Type Default Description
path String Path of the node.
data Buffer null The data buffer, optional, defaults to null.
acls Array.<ACL> null An array of ACL objects, optional, defaults to ACL.OPEN_ACL_UNSAFE
mode CreateMode null The creation mode, optional, defaults to CreateMode.PERSISTENT
Source:
Returns:
Type
AsyncTransaction

remove(path, version) → {AsyncTransaction}

Add a delete operation with the given path and optional version.
Parameters:
Name Type Description
path * Path of the node.
version * The version of the node, optional, defaults to -1.
Source:
Returns:
Type
AsyncTransaction

setData(path, data, version) → {AsyncTransaction}

Add a set-data operation with the given path, data and optional version.
Parameters:
Name Type Description
path string Path of the node.
data Buffer The data buffer, or null.
version number The version of the node, optional, defaults to -1.
Source:
Returns:
Type
AsyncTransaction