Erlang client for Antiodote

Build Status

Interface for transactions

Example

%% Starts pb socket
{ok, Pid} = antidotec_pb_socket:start(?ADDRESS, ?PORT),
BObj = {Key, riak_dt_pncounter, Bucket},
Obj = antidotec_counter:increment(Amount, antidotec_counter:new()),
{ok, TxId} = antidotec_pb:start_transaction(Pid, term_to_binary(ignore), {}),
ok = antidotec_pb:update_objects(Pid,
antidotec_counter:to_ops(BObj, Obj),
TxId),
{ok, TimeStamp} = antidotec_pb:commit_transaction(Pid, TxId),
%% Use TimeStamp for subsequent transactions if required
{ok, TxId2} = antidotec_pb:start_transaction(Pid, TimeStamp, [{static=true}]),
...
...
%% Close pb socket
_Disconnected = antidotec_pb_socket:stop(Pid),