elsa v0.12.3 Elsa.Consumer.Worker

Defines the worker GenServer that is managed by the DynamicSupervisor. Workers are instantiated and assigned to a specific topic/partition and process messages according to the specified message handler module passed in from the manager before calling the ack function to notify the cluster the messages have been successfully processed.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Start the worker process and init the state with the given config.

Link to this section Types

Link to this type

init_opts()

init_opts() :: [
  connection: Elsa.connection(),
  topic: Elsa.topic(),
  partition: Elsa.partition(),
  generation_id: non_neg_integer(),
  begin_offset: non_neg_integer(),
  handler: module(),
  handler_init_args: term(),
  config: :brod.consumer_options()
]

Link to this section Functions

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_continue(atom, state)

Callback implementation for GenServer.handle_continue/2.

Link to this function

init(init_args)

Callback implementation for GenServer.init/1.

Link to this macro

kafka_message_set(args \\ [])

(macro)
Link to this macro

kafka_message_set(record, args)

(macro)
Link to this function

start_link(init_args)

start_link(init_opts()) :: GenServer.on_start()

Start the worker process and init the state with the given config.