brodex v0.0.1 Brodex.TopicSubscriber behaviour View Source

Wrapper of :brod_topic_subscriber.

Link to this section Summary

Link to this section Types

Link to this type

callback_spec()

View Source
callback_spec() :: module() | {module(), any()}

A spec for callback.

module must implement Brodex.TopicSubscriber behaviour.

Link to this type

callback_state()

View Source
callback_state() :: term()

:brod_topic_subscriber.cb_state

Link to this type

committed_offsets()

View Source
committed_offsets() :: [{Brodex.parition(), Brodex.offset()}]

:brod_topic_subscriber.committed_offsets

Link to this section Functions

Link to this function

start_link(client, topic, callback_spec, options \\ [])

View Source
start_link(Brodex.client(), Brodex.topic(), callback_spec(), [
  start_link_option()
]) :: {:ok, pid()} | {:error, term()}

Wrapper of :brod_topic_subscriber.start_link/7.

Wrapper of :brod_topic_subscriber.stop/1.

Link to this section Callbacks

Link to this callback

handle_message(partition, message_or_message_set, callback_state)

View Source
handle_message(
  partition :: Brodex.partition(),
  message_or_message_set ::
    Brodex.Message.record() | Brodex.MessageSet.record(),
  callback_state :: callback_state()
) :: {:ok, callback_state()} | {:ok, :ack, callback_state()}