Class: KafkaSyrup::Protocol::FetchRequest
- Defined in:
- lib/kafka_syrup/protocol/fetch_request.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
-
#max_wait_time ⇒ Object
Returns the value of attribute max_wait_time.
-
#min_bytes ⇒ Object
Returns the value of attribute min_bytes.
-
#topics ⇒ Object
Returns the value of attribute topics.
Attributes inherited from Request
Instance Method Summary collapse
Methods inherited from Request
#api_key, #api_version, #initialize
Methods inherited from Base
#==, #config, #decode, #initialize
Methods included from Utils
Constructor Details
This class inherits a constructor from KafkaSyrup::Protocol::Request
Instance Attribute Details
#max_bytes ⇒ Object
Returns the value of attribute max_bytes.
6 7 8 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 6 def max_bytes @max_bytes end |
#max_wait_time ⇒ Object
Returns the value of attribute max_wait_time.
6 7 8 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 6 def max_wait_time @max_wait_time end |
#min_bytes ⇒ Object
Returns the value of attribute min_bytes.
6 7 8 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 6 def min_bytes @min_bytes end |
#topics ⇒ Object
Returns the value of attribute topics.
6 7 8 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 6 def topics @topics end |
Instance Method Details
#add_topic(name) ⇒ Object
28 29 30 31 32 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 28 def add_topic(name) topic = Topic.new(name, [], max_bytes) topics << topic topic end |
#defaults ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 8 def defaults { max_wait_time: config.consume_max_wait_time, min_bytes: config.consume_min_bytes, max_bytes: config.consume_max_bytes, topics: [] } end |
#encode ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/kafka_syrup/protocol/fetch_request.rb', line 17 def encode super do [ E.write_int32(REPLICA_ID), E.write_int32(max_wait_time), E.write_int32(min_bytes), E.write_array(topics) ].join end end |