View Source KafkaEx.Network.NetworkClient (kafka_ex v1.0.0-rc.1)

KafkaEx implementation of Client used to connect to Kafka Broker

Summary

Functions

Closes a socket and emits telemetry event.

Functions

Link to this function

close_socket(arg1, socket, reason)

View Source
@spec close_socket(map(), any(), atom()) :: :ok

Closes a socket and emits telemetry event.

This is the preferred way to close sockets when the broker context is available, as it emits [:kafka_ex, :connection, :close] telemetry event with the close reason.

Parameters

  • broker - Broker struct or map with :host and :port keys
  • socket - The socket to close (nil is a no-op)
  • reason - Why the socket is being closed (e.g., :shutdown, :timeout, :send_error)