Struct deno_kv::AtomicWrite
source · pub struct AtomicWrite {
pub checks: Vec<KvCheck>,
pub mutations: Vec<KvMutation>,
pub enqueues: Vec<Enqueue>,
}
Expand description
A request to perform an atomic check-modify-write operation on the database.
The operation is performed atomically, meaning that the operation will either succeed or fail. If the operation fails, then the database will be left in the same state as before the operation was attempted. If the operation succeeds, then the database will be left in a new state.
The operation is performed by first checking the database for the current
state of the keys, defined by the checks
field. If the current state of
the keys does not match the expected state, then the operation fails. If
the current state of the keys matches the expected state, then the
mutations are applied to the database.
All checks and mutations are performed atomically.
The mutations are performed in the order that they are specified in the
mutations
field. The order of checks is not specified, and is also not
important because this ordering is un-observable.
Fields§
§checks: Vec<KvCheck>
§mutations: Vec<KvMutation>
§enqueues: Vec<Enqueue>