Class: Heller::FetchResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/heller/fetch_response.rb

Instance Method Summary collapse

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(underlying, decoder)
  @underlying, @decoder = underlying, 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

Returns:

  • (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 messages(topic, partition)
  convert_error { MessageSetEnumerator.new(@underlying.message_set(topic, partition), @decoder) }
end