Class: PendingCommit
Defined in: netconf/src/operations/transaction.ts:540
A confirmed commit waiting for confirmation (RFC 6241 §8.4). The server reverts it unless confirm() reaches it before expires.
The candidate lock is held until it is confirmed, cancelled, expires or the session closes, so no other session can edit the candidate and commit it (which would confirm ours early). The running lock is released as soon as the confirmed commit succeeds: the server's revert writes running, and holding running's lock can stop it (netopeer2 then keeps the commit for good).
await using pending = … cancels it on scope exit if it is still pending.
Implements
AsyncDisposable
Properties
expires
readonly expires: Date;Defined in: netconf/src/operations/transaction.ts:544
When the server reverts the commit, measured on this machine from when the commit succeeded.
persistId
readonly persistId: string | undefined;Defined in: netconf/src/operations/transaction.ts:542
The persist id, when the commit was made with persist (it then outlives the session).
Accessors
state
Get Signature
get state(): PendingCommitState;Defined in: netconf/src/operations/transaction.ts:572
pending: waiting for confirm() or cancel()confirmed,cancelled: settled by this handleexpired: the timeout passed and the server reverted the commitclosed: the session ended. The server reverted the commit unless it was made withpersist; a persistent one can still be confirmed or cancelled from another session withclient.ops.commit({ persistId })orclient.ops.cancelCommit({ persistId }).
Returns
Methods
[asyncDispose]()
[asyncDispose](): Promise<void>;Defined in: netconf/src/operations/transaction.ts:608
Cancel if still pending.
Returns
Promise<void>
Implementation of
AsyncDisposable.[asyncDispose]
cancel()
cancel(options?): Promise<void>;Defined in: netconf/src/operations/transaction.ts:596
Revert the commit now with <cancel-commit> (needs :confirmed-commit:1.1), discard the candidate and release the locks.
Parameters
options?
RpcOptions = {}
Returns
Promise<void>
confirm()
confirm(options?): Promise<void>;Defined in: netconf/src/operations/transaction.ts:581
Confirm the commit with <commit> (carrying <persist-id> if it was made with persist), then release the locks. Refused locally once settled, or when less than CONFIRM_MARGIN_MS remain before it expires.
Parameters
options?
RpcOptions = {}
Returns
Promise<void>