ex_shards v0.2.1 ExShards.State

Shards State.

This module overrides the original shards_state getter and setter functions in order to make them more Elixir-friendly – e.g.: take advantage of pipe-operator.

Examples

state = ExShards.State.new
|> ExShards.State.module(:shards_dist)
|> ExShards.State.n_shards(4)
|> ExShards.State.pick_shard_fun(fun)
|> ExShards.State.pick_node_fun(fun)

Link to this section Summary

Link to this section Types

Link to this type key()
key() :: term
Link to this type op()
op() :: :r | :w | :d
Link to this type pick_fun()
pick_fun() :: (key, range, op -> integer | :any)
Link to this type range()
range() :: integer
Link to this type t()
t() :: {:state, module, integer, pick_fun, pick_fun}

Link to this section Functions

Link to this function from_map(Elixir.arg1)
Link to this function get(Elixir.arg1)
Link to this function is_state(Elixir.arg1)
Link to this function module(Elixir.arg1)
Link to this function module(state, module)
module(t, module) :: t
Link to this function n_shards(Elixir.arg1)
Link to this function n_shards(state, n_shards)
n_shards(t, integer) :: t
Link to this function new(Elixir.arg1)
Link to this function new(Elixir.arg1, Elixir.arg2)
Link to this function new(Elixir.arg1, Elixir.arg2, Elixir.arg3)
Link to this function new(Elixir.arg1, Elixir.arg2, Elixir.arg3, Elixir.arg4)
Link to this function new(Elixir.arg1, Elixir.arg2, Elixir.arg3, Elixir.arg4, Elixir.arg5)
Link to this function pick_node_fun(Elixir.arg1)
Link to this function pick_node_fun(state, pick_node_fun)
pick_node_fun(t, pick_fun) :: t
Link to this function pick_shard_fun(Elixir.arg1)
Link to this function pick_shard_fun(state, pick_shard_fun)
pick_shard_fun(t, pick_fun) :: t
Link to this function scope(Elixir.arg1)
Link to this macro state(args \\ []) (macro)
Link to this macro state(record, args) (macro)
Link to this function sup_name(Elixir.arg1)
Link to this function sup_name(Elixir.arg1, Elixir.arg2)
Link to this function to_map(Elixir.arg1)