brodex v0.0.2 Brodex.GroupSubscriber behaviour View Source

Wrapper of :brod_group_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.GroupSubscriber behaviour.

Link to this type

callback_state()

View Source
callback_state() :: term()

:brod_group_subscriber.cb_state

Link to this section Functions

Link to this function

start_link(client, group_id, topics, callback_spec, options)

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

Wrapper of :brod_group_subscriber.start_link/8.

Wrapper of :brod_group_subscriber.stop/1.

Link to this section Callbacks

Link to this callback

handle_message(topic, partition, message_or_message_set, callback_state)

View Source
handle_message(
  topic :: Brodex.topic(),
  partition :: Brodex.partition(),
  message_or_message_set ::
    Brodex.Message.record() | Brodex.MessageSet.record(),
  callback_state :: callback_state()
) ::
  {:ok, callback_state()}
  | {:ok, :ack, callback_state()}
  | {:ok, :ack_no_commit, callback_state()}
Link to this callback

init(group_id, term)

View Source
init(group_id :: Brodex.group_id(), term()) :: {:ok, callback_state()}