Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Commit d5b1c8d

Browse files
committed
more precise types
1 parent ed86f16 commit d5b1c8d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/antidote_pb_codec.erl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
% encoding on wire (used to be decode_msg and encode_msg)
4040

4141
% these are all top-level messages which can be sent on the wire
42-
-export_type([sendable/0, request/0, response/0, message/0, update/0]).
42+
-export_type([sendable/0, request/0, response/0, message/0, update/0, read_result/0]).
4343

4444
-type sendable() ::
4545
#'ApbErrorResp'{}
@@ -59,7 +59,13 @@
5959
-type bound_object() :: {Key :: binary(), Type :: atom(), Bucket :: binary()}.
6060
-type update() :: {Object :: bound_object(), Op :: atom(), Param :: any()}.
6161
-type error_code() :: unknown | timeout | {error_code, integer()}.
62-
62+
-type read_result() ::
63+
{counter, integer()}
64+
| {set, [binary()]}
65+
| {reg, binary()}
66+
| {mvreg, [binary()]}
67+
| {map, [{{Key :: binary(), Type :: atom()}, Value :: read_result()}]}
68+
| {flag, boolean()}.
6369

6470
-type request() ::
6571
{start_transaction, {Clock :: binary(), Properties :: list()}}
@@ -72,8 +78,8 @@
7278

7379
-type response() ::
7480
{error_resp, {ErrorCode :: error_code(), Message :: binary()}}
75-
| {start_transaction_resp, Resp :: atom()}
76-
| {error_response, Resp :: any()}
81+
| {start_transaction_resp, Resp :: {ok, TxId :: binary} | {error, Reason::any()}}
82+
| {error_response, {error_code(), Message :: binary()}}
7783
| {static_read_objects_resp, {ok, Results :: list(), CommitTime :: binary()}}
7884
| {read_objects_resp, Resp :: list()}.
7985

0 commit comments

Comments
 (0)