ExRingRing.Domain.Entities.Ring (ex_ring_ring v0.1.0)

Copy Markdown

Entity representing a consistent hash ring.

The ring contains an implementation module, implementation state, and configuration.

Summary

Functions

Gets the configuration.

Gets the implementation module.

Gets the implementation state.

Gets the implementation module (alias).

Gets the implementation state (alias).

Checks if the given term is a valid ring.

Updates the implementation state.

Types

t()

@type t() :: %ExRingRing.Domain.Entities.Ring{
  config: ExRingRing.Domain.ValueObjects.HashConfig.t(),
  impl_module: module(),
  impl_state: term()
}

Functions

get_config(ring)

Gets the configuration.

get_impl_module(ring)

@spec get_impl_module(t()) :: module()

Gets the implementation module.

get_impl_state(ring)

@spec get_impl_state(t()) :: term()

Gets the implementation state.

get_implementation(ring)

@spec get_implementation(t()) :: module()

Gets the implementation module (alias).

get_state(ring)

@spec get_state(t()) :: term()

Gets the implementation state (alias).

is_ring(arg1)

@spec is_ring(term()) :: boolean()

Checks if the given term is a valid ring.

new(impl_module, impl_state, config)

Creates a new ring.

update_state(ring, new_state)

@spec update_state(t(), term()) :: t()

Updates the implementation state.