rafted_value v0.1.1 RaftedValue.Leadership

Summary

Functions

Type-aware getter for follower_responded_times

Type-aware setter for follower_responded_times

Type-aware getter for heartbeat_timer

Type-aware setter for heartbeat_timer

Creates a new instance of Elixir.RaftedValue.Leadership by using the given dict and the default value of each field. Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s validate/1 function

A variant of new/1 which returns t or raise if validation fails. In other words, new/1 followed by Croma.Result.get!/1

Type-aware getter for quorum_timer

Type-aware setter for quorum_timer

Type-aware getter for quorum_timer_started_at

Type-aware setter for quorum_timer_started_at

Updates an existing instance of Elixir.RaftedValue.Leadership with the given dict. The values in the dict are validated by each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1

Checks that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of validate/1 which returns t or raise if validation fails. In other words, validate/1 followed by Croma.Result.get!/1

Types

t :: %RaftedValue.Leadership{follower_responded_times: Croma.Map.t, heartbeat_timer: Croma.Reference.t, quorum_timer: Croma.Reference.t, quorum_timer_started_at: Croma.Integer.t}

Functions

can_safely_remove?(l, a1, follower, config)

Specs

follower_responded(l, a1, follower, config)
follower_responded_times(leadership)

Specs

follower_responded_times(t) :: Croma.Map.t

Type-aware getter for follower_responded_times.

follower_responded_times(s, field)

Specs

follower_responded_times(t, Croma.Map.t) :: t

Type-aware setter for follower_responded_times.

heartbeat_timer(leadership)

Specs

heartbeat_timer(t) :: Croma.Reference.t

Type-aware getter for heartbeat_timer.

heartbeat_timer(s, field)

Specs

heartbeat_timer(t, Croma.Reference.t) :: t

Type-aware setter for heartbeat_timer.

minimum_timeout_elapsed_since_quorum_responded?(a0, a1)

Specs

minimum_timeout_elapsed_since_quorum_responded?(RaftedValue.Leadership.t, RaftedValue.Config.t) :: boolean
new(dict)

Specs

new(Dict.t) :: Croma.Result.t(t)

Creates a new instance of Elixir.RaftedValue.Leadership by using the given dict and the default value of each field. Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s validate/1 function.

new!(dict)

Specs

new!(Dict.t) :: t

A variant of new/1 which returns t or raise if validation fails. In other words, new/1 followed by Croma.Result.get!/1.

new_for_leader(config)

Specs

new_for_leader(RaftedValue.Config.t) :: t
quorum_timer(leadership)

Specs

quorum_timer(t) :: Croma.Reference.t

Type-aware getter for quorum_timer.

quorum_timer(s, field)

Specs

quorum_timer(t, Croma.Reference.t) :: t

Type-aware setter for quorum_timer.

quorum_timer_started_at(leadership)

Specs

quorum_timer_started_at(t) :: Croma.Integer.t

Type-aware getter for quorum_timer_started_at.

quorum_timer_started_at(s, field)

Specs

quorum_timer_started_at(t, Croma.Integer.t) :: t

Type-aware setter for quorum_timer_started_at.

reset_heartbeat_timer(l, config)

Specs

reset_heartbeat_timer(RaftedValue.Leadership.t, RaftedValue.Config.t) :: t
reset_quorum_timer(l, config, now \\ monotonic_millis)

Specs

reset_quorum_timer(RaftedValue.Leadership.t, RaftedValue.Config.t, integer) :: t
stop_timers(a0)

Specs

stop_timers(RaftedValue.Leadership.t) :: :ok
unresponsive_followers(a0, config)

Specs

unresponsive_followers(RaftedValue.Leadership.t, RaftedValue.Config.t) :: [pid]
update(s, dict)

Specs

update(t, Dict.t) :: Croma.Result.t(t)

Updates an existing instance of Elixir.RaftedValue.Leadership with the given dict. The values in the dict are validated by each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}.

update!(s, dict)

Specs

update!(t, Dict.t) :: t

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

validate(dict)

Specs

validate(Dict.t) :: Croma.Result.t(t)

Checks that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}.

validate!(dict)

Specs

validate!(Dict.t) :: t

A variant of validate/1 which returns t or raise if validation fails. In other words, validate/1 followed by Croma.Result.get!/1.