Packages
elsa_kafka
2.0.0
Elsa is a full-featured Kafka library written in Elixir and extending the :brod library with additional support from the :kafka_protocol Erlang libraries to provide capabilities not available in :brod.
Current section
Files
Jump to
Current section
Files
lib/elsa/partitioner/random.ex
defmodule Elsa.Partitioner.Random do
@moduledoc """
Randomly chooses a topic partition uniformly from the available
number of partitions.
"""
@behaviour Elsa.Partitioner
def partition(count, _key) do
:rand.uniform(count) - 1
end
end