Class: KafkaSyrup::Protocol::Response
- Defined in:
- lib/kafka_syrup/protocol/response.rb
Direct Known Subclasses
FetchResponse, MetadataResponse, OffsetResponse, ProduceResponse
Instance Attribute Summary collapse
-
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
Instance Method Summary collapse
Methods inherited from Base
#==, #config, #defaults, #initialize
Methods included from Utils
Constructor Details
This class inherits a constructor from KafkaSyrup::Protocol::Base
Instance Attribute Details
#correlation_id ⇒ Object
Returns the value of attribute correlation_id.
5 6 7 |
# File 'lib/kafka_syrup/protocol/response.rb', line 5 def correlation_id @correlation_id end |
Instance Method Details
#decode(io) ⇒ Object
16 17 18 19 |
# File 'lib/kafka_syrup/protocol/response.rb', line 16 def decode(io) super(io) self.correlation_id = E.read_int32(io) end |
#encode(&block) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/kafka_syrup/protocol/response.rb', line 7 def encode(&block) super do [ E.write_int32(correlation_id.to_i), block_given? ? yield : "" ].join end end |