Class: Kafka::ConnectionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/kafka/connection_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(client_id:, logger:, instrumenter:, connect_timeout:, socket_timeout:, ssl_context:) ⇒ ConnectionBuilder

Returns a new instance of ConnectionBuilder.


3
4
5
6
7
8
9
10
# File 'lib/kafka/connection_builder.rb', line 3

def initialize(client_id:, logger:, instrumenter:, connect_timeout:, socket_timeout:, ssl_context:)
  @client_id = client_id
  @logger = logger
  @instrumenter = instrumenter
  @connect_timeout = connect_timeout
  @socket_timeout = socket_timeout
  @ssl_context = ssl_context
end

Instance Method Details

#build_connection(host, port) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kafka/connection_builder.rb', line 12

def build_connection(host, port)
  Connection.new(
    host: host,
    port: port,
    client_id: @client_id,
    connect_timeout: @connect_timeout,
    socket_timeout: @socket_timeout,
    logger: @logger,
    instrumenter: @instrumenter,
    ssl_context: @ssl_context,
  )
end