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().
Pid of the helper process to track unacked writes.
-type from() :: gen_server:from().
gen_server's caller.
-type server_pid() :: cets:server_pid().
Pid of CETS gen_server.
-type state() :: #{servers := [server_pid()], from() => [server_pid(), ...]}.

Link to this section Functions

Link to this function

ack(AckPid, From, RemotePid)

View Source
-spec ack(ack_pid(), from(), server_pid()) -> ok.
Called by a remote server after an operation is applied.
-spec add(ack_pid(), from()) -> ok.
Adds a new task to wait for replies.
Link to this function

send_remote_down(AckPid, RemotePid)

View Source
-spec send_remote_down(ack_pid(), server_pid()) -> ok.
Calls ack(AckPid, From, RemotePid) for all locally tracked From entries.
Link to this function

set_servers(AckPid, Servers)

View Source
-spec set_servers(ack_pid(), [server_pid()]) -> ok.
Sets a list of servers to be used for newly added tasks.
-spec start_link(cets:table_name()) -> gen_server:start_ret().
Starts a helper process to track unacked writes.