Concord.Txn.Result (Concord v2.0.0)

Copy Markdown View Source

Result of a committed transaction.

  • succeededtrue if the success branch ran, false if the failure branch ran. A succeeded: false result is not an error — it means the compares didn't hold.
  • revision — cluster revision after the transaction (unchanged if no mutation occurred).
  • responses — ordered list of operation responses from the executed branch.

Summary

Types

response()

@type response() ::
  {:get, term(), %{kvs: [Concord.KV.Record.t()], count: non_neg_integer()}}
  | {:put, binary(), %{prev_kv: Concord.KV.Record.t() | nil}}
  | {:delete, term(),
     %{deleted: non_neg_integer(), prev_kvs: [Concord.KV.Record.t()]}}
  | {:touch, binary(), %{ttl: integer() | :not_found}}

t()

@type t() :: %Concord.Txn.Result{
  responses: [response()],
  revision: non_neg_integer(),
  succeeded: boolean()
}