View Source KafkaEx.API.Behaviour behaviour (kafka_ex v1.0.0-rc.1)

Behaviour for modules using KafkaEx.API.

This behaviour defines the callback that must be implemented when using KafkaEx.API in your module.

Example

defmodule MyApp.Kafka do
  use KafkaEx.API

  @impl KafkaEx.API.Behaviour
  def client do
    MyApp.KafkaClient
  end
end

Summary

Callbacks

Returns the client pid or name to use for API calls.

Callbacks

@callback client() :: GenServer.server()

Returns the client pid or name to use for API calls.

This callback is automatically injected when you use KafkaEx.API with the :client option. If you don't provide the :client option, you must implement this callback yourself.