Class: Kafka::Protocol::HeartbeatRequest

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

Instance Method Summary collapse

Constructor Details

#initialize(group_id:, generation_id:, member_id:) ⇒ HeartbeatRequest

Returns a new instance of HeartbeatRequest


6
7
8
9
10
# File 'lib/kafka/protocol/heartbeat_request.rb', line 6

def initialize(group_id:, generation_id:, member_id:)
  @group_id = group_id
  @generation_id = generation_id
  @member_id = member_id
end

Instance Method Details

#api_keyObject


12
13
14
# File 'lib/kafka/protocol/heartbeat_request.rb', line 12

def api_key
  HEARTBEAT_API
end

#encode(encoder) ⇒ Object


20
21
22
23
24
# File 'lib/kafka/protocol/heartbeat_request.rb', line 20

def encode(encoder)
  encoder.write_string(@group_id)
  encoder.write_int32(@generation_id)
  encoder.write_string(@member_id)
end

#response_classObject


16
17
18
# File 'lib/kafka/protocol/heartbeat_request.rb', line 16

def response_class
  HeartbeatResponse
end