Class: Heller::FetchResponse
- Inherits:
-
Object
- Object
- Heller::FetchResponse
- Defined in:
- lib/heller/fetch_response.rb
Instance Method Summary collapse
- #error(topic, partition) ⇒ Object
- #error? ⇒ Boolean
- #high_watermark(topic, partition) ⇒ Object
-
#initialize(underlying, decoder) ⇒ FetchResponse
constructor
A new instance of FetchResponse.
- #messages(topic, partition) ⇒ Object
Constructor Details
#initialize(underlying, decoder) ⇒ FetchResponse
Returns a new instance of FetchResponse.
5 6 7 |
# File 'lib/heller/fetch_response.rb', line 5 def initialize(, decoder) @underlying, @decoder = , decoder end |
Instance Method Details
#error(topic, partition) ⇒ Object
13 14 15 |
# File 'lib/heller/fetch_response.rb', line 13 def error(topic, partition) convert_error { @underlying.error_code(topic, partition) } end |
#error? ⇒ Boolean
9 10 11 |
# File 'lib/heller/fetch_response.rb', line 9 def error? @underlying.has_error? end |
#high_watermark(topic, partition) ⇒ Object
21 22 23 |
# File 'lib/heller/fetch_response.rb', line 21 def high_watermark(topic, partition) convert_error { @underlying.high_watermark(topic, partition) } end |
#messages(topic, partition) ⇒ Object
17 18 19 |
# File 'lib/heller/fetch_response.rb', line 17 def (topic, partition) convert_error { MessageSetEnumerator.new(@underlying.(topic, partition), @decoder) } end |