View Source cets_call (cets v0.2.0)
Link to this section Summary
Types
Message type.
Return result.
Operations are messages which could be buffered when a server is paused. Operations are also broadcasted to the whole cluster.
Asynchronous request reference.
Server name or pid.
Functions
Contacts the local server to broadcast multinode operation.
Makes gen_server:call with better error reporting.
Makes gen_server:call with better error reporting.
Sends all requests to a single node in the cluster.
Contacts the local server to broadcast multinode operation.
Waits for multiple responses at once.
Link to this section Types
-type long_msg() :: cets:long_msg().
-type ok_or_error() :: ok | {error, Reason :: term()}.
-type op() :: cets:op().
-type request_id() :: cets:request_id().
-type server_ref() :: cets:server_ref().
Link to this section Functions
-spec async_operation(server_ref(), op()) -> request_id().
Contacts the local server to broadcast multinode operation.
Returns immediately. You can wait for response from all nodes by callingwait_response/2
.
-spec long_call(server_ref(), long_msg()) -> term().
Makes gen_server:call with better error reporting.
It would log a warning if the call takes too long.-spec long_call(server_ref(), long_msg(), map()) -> term().
-spec send_leader_op(server_ref(), op()) -> ok_or_error().
-spec sync_operation(server_ref(), op()) -> ok.
Contacts the local server to broadcast multinode operation.
Blocks until the operation is applied on all nodes.-spec wait_responses([gen_server:request_id()], cets:response_timeout()) -> [cets:response_return()].