View Source cets_ack (cets v0.2.0)
Helper module to keep track of unacked writes.
Contains a list of processes, that are waiting for writes to finish. Collects acks from nodes in the cluster. When one of the remote nodes goes down, the server stops waiting for acks from it.Link to this section Summary
Types
Pid of the helper process to track unacked writes.
gen_server's caller.
Pid of CETS gen_server.
Functions
Called by a remote server after an operation is applied.
Adds a new task to wait for replies.
Calls
ack(AckPid, From, RemotePid)
for all locally tracked From entries.Sets a list of servers to be used for newly added tasks.
Starts a helper process to track unacked writes.
Link to this section Types
-type ack_pid() :: pid().
-type from() :: gen_server:from().
-type server_pid() :: cets:server_pid().
-type state() :: #{servers := [server_pid()], from() => [server_pid(), ...]}.
Link to this section Functions
-spec ack(ack_pid(), from(), server_pid()) -> ok.
-spec send_remote_down(ack_pid(), server_pid()) -> ok.
ack(AckPid, From, RemotePid)
for all locally tracked From entries.
-spec set_servers(ack_pid(), [server_pid()]) -> ok.
-spec start_link(cets:table_name()) -> gen_server:start_ret().