ExHashRing.Info (ex_hash_ring v6.0.4) View Source

Provides an interface for querying information about Rings.

Each Ring has some associated information that is available at all times to aid in performing client-context queries into the underlying ETS table.non_neg_integer()

Link to this section Summary

Types

For any ring information can be looked up that will provide an entry containing specifics about the table holding the ring data, the configured history depth, sizes for each generation in the history, the current generation, and any overrides that should be applied during lookup.

t()

Functions

Returns a specification to start this module under a supervisor.

Retrieves the info entry for the specified ring.

Callback implementation for GenServer.init/1.

Sets the info entry for the specified ring.

Link to this section Types

Specs

entry() ::
  {table :: :ets.tid(), depth :: ExHashRing.Ring.depth(),
   sizes :: [ExHashRing.Ring.size()],
   generation :: ExHashRing.Ring.generation(),
   overrides :: ExHashRing.Ring.overrides()}

For any ring information can be looked up that will provide an entry containing specifics about the table holding the ring data, the configured history depth, sizes for each generation in the history, the current generation, and any overrides that should be applied during lookup.

Specs

t() :: %ExHashRing.Info{monitored_pids: %{required(pid()) => reference()}}

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

get(name :: ExHashRing.Ring.name()) :: {:ok, entry()} | {:error, :no_ring}
get(pid()) :: {:ok, entry()} | {:error, :no_ring}

Retrieves the info entry for the specified ring.

Specs

init(:ok) :: {:ok, t()}

Callback implementation for GenServer.init/1.

Specs

set(name :: ExHashRing.Ring.name(), entry()) :: :ok | {:error, :no_ring}
set(pid(), entry()) :: :ok

Sets the info entry for the specified ring.

Specs

start_link() :: GenServer.on_start()