brodex v0.0.1 Brodex.TopicSubscriber behaviour View Source
Wrapper of :brod_topic_subscriber
.
Link to this section Summary
Types
A spec for callback.
Link to this section Types
A spec for callback.
module
must implement Brodex.TopicSubscriber
behaviour.
Link to this type
committed_offsets()
View Sourcecommitted_offsets() :: [{Brodex.parition(), Brodex.offset()}]
Link to this type
start_link_option()
View Sourcestart_link_option() :: {:client, Brodex.client()} | {:partition, :all | [Brodex.partition()]} | {:consumer_config, Brodex.consumer_config()} | {:message_type, :message | :message_set}
Link to this section Functions
Link to this function
start_link(client, topic, callback_spec, options \\ [])
View Sourcestart_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 Sourcehandle_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()}
Link to this callback
init(topic, term)
View Sourceinit(topic :: Brodex.topic(), term()) :: {:ok, committed_offsets(), :brod_topic_subscriber.cb_state()}