Behaviours: gen_server.
This module defines the brod_topic_subscriber behaviour.
Required callback functions: init/2, handle_message/3.
cb_fun() = fun((brod:partition(), brod:message() | brod:message_set(), cb_state()) -> cb_ret())
cb_ret() = {ok, cb_state()} | {ok, ack, cb_state()}
cb_state() = term()
committed_offsets() = [{brod:partition(), brod:offset()}]
ack/3 | Acknowledge that message has been sucessfully consumed. |
code_change/3 | |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
init/1 | |
start_link/6 | Start (link) a topic subscriber which receives and processes the messages from the given partition set. |
start_link/7 | Start (link) a topic subscriber which receives and processes the messages or message sets from the given partition set. |
start_link/8 | Start (link) a topic subscriber which receives and processes the messages from the given partition set. |
stop/1 | Stop topic subscriber. |
terminate/2 |
ack(Pid::pid(), Partition::brod:partition(), Offset::brod:offset()) -> ok
Acknowledge that message has been sucessfully consumed.
code_change(OldVsn, State, Extra) -> any()
handle_call(Call, From, State) -> any()
handle_cast(Cast, State) -> any()
handle_info(Info, State0) -> any()
init(X1) -> any()
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), CbModule::module(), CbInitArg::term()) -> {ok, pid()} | {error, any()}
Start (link) a topic subscriber which receives and processes the messages from the given partition set. Use atom 'all' to subscribe to all partitions. Messages are handled by calling CbModule:handle_message
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), MessageType::message | message_set, CbModule::module(), CbInitArg::term()) -> {ok, pid()} | {error, any()}
Start (link) a topic subscriber which receives and processes the messages or message sets from the given partition set. Use atom 'all' to subscribe to all partitions. Messages are handled by calling CbModule:handle_message
start_link(Client::brod:client(), Topic::brod:topic(), Partitions::all | [brod:partition()], ConsumerConfig::brod:consumer_config(), CommittedOffsets::committed_offsets(), MessageType::message | message_set, CbFun::cb_fun(), CbInitialState::cb_state()) -> {ok, pid()} | {error, any()}
Start (link) a topic subscriber which receives and processes the messages from the given partition set. Use atom 'all' to subscribe to all partitions. Messages are handled by calling the callback function.
NOTE: CommittedOffsets are the offsets for the messages that are successfully processed (acknoledged), not the begin-offset ot start fetching from.stop(Pid::pid()) -> ok
Stop topic subscriber.
terminate(Reason, State) -> any()
Generated by EDoc