Class: Rdkafka::Callbacks::ListOffsetsResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/callbacks.rb

Overview

Extracts attributes of rd_kafka_ListOffsets_result_t

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_ptr) ⇒ ListOffsetsResult

Returns a new instance of ListOffsetsResult.

Parameters:

  • event_ptr (FFI::Pointer)

    pointer to the event



190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/rdkafka/callbacks.rb', line 190

def initialize(event_ptr)
  @result_infos = FFI::Pointer::NULL
  @result_error = Rdkafka::Bindings.rd_kafka_event_error(event_ptr)
  @error_string = Rdkafka::Bindings.rd_kafka_event_error_string(event_ptr)

  if @result_error == Rdkafka::Bindings::RD_KAFKA_RESP_ERR_NO_ERROR
    list_offsets_result = Rdkafka::Bindings.rd_kafka_event_ListOffsets_result(event_ptr)
    pointer_to_size_t = FFI::MemoryPointer.new(:size_t)
    @result_infos = Rdkafka::Bindings.rd_kafka_ListOffsets_result_infos(list_offsets_result, pointer_to_size_t)
    @result_count = pointer_to_size_t.read(:size_t)
  end
end

Instance Attribute Details

#error_stringObject (readonly)

Returns the value of attribute error_string.



187
188
189
# File 'lib/rdkafka/callbacks.rb', line 187

def error_string
  @error_string
end

#result_countObject (readonly)

Returns the value of attribute result_count.



187
188
189
# File 'lib/rdkafka/callbacks.rb', line 187

def result_count
  @result_count
end

#result_errorObject (readonly)

Returns the value of attribute result_error.



187
188
189
# File 'lib/rdkafka/callbacks.rb', line 187

def result_error
  @result_error
end

#result_infosObject (readonly)

Returns the value of attribute result_infos.



187
188
189
# File 'lib/rdkafka/callbacks.rb', line 187

def result_infos
  @result_infos
end