kafka_ex v0.6.1 KafkaEx.Server behaviour

Defines the KafkaEx.Server behavior that all Kafka API servers must implement, this module also provides some common callback functions that are injected into the servers that use it.

Summary

Callbacks

kafka_server_consumer_group(state)

Specs

kafka_server_consumer_group(state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_consumer_group_metadata(state)

Specs

kafka_server_consumer_group_metadata(state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_create_stream(handler, handler_init, state)

Specs

kafka_server_create_stream(handler :: term, handler_init :: term, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_fetch(fetch_request, state)

Specs

kafka_server_fetch(fetch_request :: FetchRequest.t, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_heartbeat(group_name, generation_id, member_id, state)

Specs

kafka_server_heartbeat(group_name :: binary, generation_id :: integer, member_id :: integer, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_init(args)

Specs

kafka_server_init(args :: [term]) ::
  {:ok, state} |
  {:ok, state, timeout | :hibernate} |
  :ignore |
  {:stop, reason :: any} when state: any
kafka_server_join_group(topics, session_timeout, state)

Specs

kafka_server_join_group(topics :: [binary], session_timeout :: integer, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_metadata(topic, state)

Specs

kafka_server_metadata(topic :: binary, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_offset(topic, parition, time, state)

Specs

kafka_server_offset(topic :: binary, parition :: integer, time :: integer | :latest | :earliest, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_offset_commit(request, state)

Specs

kafka_server_offset_commit(request :: KafkaEx.Protocol.OffsetCommit.Request.t, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_offset_fetch(request, state)

Specs

kafka_server_offset_fetch(request :: KafkaEx.Protocol.OffsetFetch.Request.t, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_produce(request, state)

Specs

kafka_server_produce(request :: KafkaEx.Protocol.Produce.Request.t, state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_start_streaming(fetch_request, state)

Specs

kafka_server_start_streaming(fetch_request :: FetchRequest.t, state :: KafkaEx.Server.State.t) ::
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason :: term, new_state} when new_state: term
kafka_server_stop_streaming(state)

Specs

kafka_server_stop_streaming(state :: KafkaEx.Server.State.t) ::
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason :: term, new_state} when new_state: term
kafka_server_sync_group(group_name, generation_id, member_id, assignments, state)

Specs

kafka_server_sync_group(group_name :: binary, generation_id :: integer, member_id :: binary, assignments :: [binary], state :: KafkaEx.Server.State.t) ::
  {:reply, reply, new_state} |
  {:reply, reply, new_state, timeout | :hibernate} |
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason, reply, new_state} |
  {:stop, reason, new_state} when reply: term, new_state: term, reason: term
kafka_server_update_consumer_metadata(state)

Specs

kafka_server_update_consumer_metadata(state :: KafkaEx.Server.State.t) ::
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason :: term, new_state} when new_state: term
kafka_server_update_metadata(state)

Specs

kafka_server_update_metadata(state :: KafkaEx.Server.State.t) ::
  {:noreply, new_state} |
  {:noreply, new_state, timeout | :hibernate} |
  {:stop, reason :: term, new_state} when new_state: term