Kaffe v1.8.0 Kaffe.PartitionSelector

Summary

Functions

md5(key, total)
random(total)
round_robin(current, total)

Cycle current from 0 to total-1.

Examples

iex> Kaffe.PartitionSelector.round_robin(nil, 3) 0

iex> Kaffe.PartitionSelector.round_robin(0, 3) 1

iex> Kaffe.PartitionSelector.round_robin(1, 3) 2

iex> Kaffe.PartitionSelector.round_robin(2, 3) 0