Packages

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
elsa_kafka lib elsa partitioner.ex
Raw

lib/elsa/partitioner.ex

defmodule Elsa.Partitioner do
@moduledoc """
Behaviour for partitioning messages produced to Kafka.
"""
@typedoc """
The number of partitions for a topic.
"""
@type partition_count :: pos_integer
@typedoc """
Partition selected by the partitioning strategy.
"""
@type partition :: non_neg_integer
@callback partition(partition_count, key :: term) :: partition
end