SHARE
TWEET

Untitled

a guest Oct 21st, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. iex(14)> ring = HashRing.new() |> HashRing.add_node(:a) |> HashRing.add_node(:b)
  2. #<Ring[:a, :b]>
  3. iex(15)> [:foo, :bar, :baz, :flop] |> Enum.each(fn(k) -> IO.puts(HashRing.key_to_node(ring, k)) end)
  4. b
  5. b
  6. b
  7. a
  8. :ok
  9. iex(16)> ring = HashRing.add_node(ring, :c)
  10. #<Ring[:a, :c, :b]>
  11. iex(17)> [:foo, :bar, :baz, :flop] |> Enum.each(fn(k) -> IO.puts(HashRing.key_to_node(ring, k)) end)
  12. c
  13. c
  14. b
  15. a
  16. :ok
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top