kafka_ex v0.6.2 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)
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)
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)
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)
kafka_server_fetch(fetch_request :: KafkaEx.Protocol.Fetch.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_heartbeat(group_name, generation_id, member_id, state)
kafka_server_heartbeat(group_name :: binary, generation_id :: integer, member_id :: 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_init(args)
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)
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_leave_group(group_name, member_id, state)
kafka_server_leave_group(group_name :: binary, member_id :: 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_metadata(topic, state)
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)
kafka_server_offset(topic :: binary, parition :: integer, time :: :calendar.datetime | :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)
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)
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)
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)
kafka_server_start_streaming(fetch_request :: KafkaEx.Protocol.Fetch.Request.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)
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)
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