EasyRpc.NodeUtils (EasyRpc v0.2.1)

View Source

NodeUtils is a helper module to help get target node in Elixir cluster. Support strategies: random, round-robin, hash. For case round-robin, the module will using process dictionary to store the current index.

Summary

Functions

Helper function to calculate target node by random, round-robin, or hash.

Functions

select_node(nodes, strategy, data)

@spec select_node(
  [node()] | {atom(), atom(), list()},
  :random | :round_robin | :hash,
  {atom(), any()}
) ::
  node()

Helper function to calculate target node by random, round-robin, or hash.