Class: Rdkafka::Callbacks::GroupResult
- Inherits:
-
Object
- Object
- Rdkafka::Callbacks::GroupResult
- Defined in:
- lib/rdkafka/callbacks.rb
Overview
Extracts attributes of rd_kafka_group_result_t
Instance Attribute Summary collapse
-
#error_string ⇒ Object
readonly
Returns the value of attribute error_string.
-
#result_error ⇒ Object
readonly
Returns the value of attribute result_error.
-
#result_name ⇒ Object
readonly
Returns the value of attribute result_name.
Class Method Summary collapse
-
.create_group_results_from_array(count, array_pointer) ⇒ Array<GroupResult>
Array of group results.
Instance Method Summary collapse
-
#initialize(group_result_pointer) ⇒ GroupResult
constructor
A new instance of GroupResult.
Constructor Details
#initialize(group_result_pointer) ⇒ GroupResult
Returns a new instance of GroupResult.
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/rdkafka/callbacks.rb', line 38 def initialize(group_result_pointer) native_error = Rdkafka::Bindings.rd_kafka_group_result_error(group_result_pointer) if native_error.null? @result_error = Rdkafka::Bindings::RD_KAFKA_RESP_ERR_NO_ERROR @error_string = FFI::Pointer::NULL else @result_error = native_error[:code] @error_string = native_error[:errstr] end @result_name = Rdkafka::Bindings.rd_kafka_group_result_name(group_result_pointer) end |
Instance Attribute Details
#error_string ⇒ Object (readonly)
Returns the value of attribute error_string.
35 36 37 |
# File 'lib/rdkafka/callbacks.rb', line 35 def error_string @error_string end |
#result_error ⇒ Object (readonly)
Returns the value of attribute result_error.
35 36 37 |
# File 'lib/rdkafka/callbacks.rb', line 35 def result_error @result_error end |
#result_name ⇒ Object (readonly)
Returns the value of attribute result_name.
35 36 37 |
# File 'lib/rdkafka/callbacks.rb', line 35 def result_name @result_name end |
Class Method Details
.create_group_results_from_array(count, array_pointer) ⇒ Array<GroupResult>
Returns array of group results.
55 56 57 58 59 60 |
# File 'lib/rdkafka/callbacks.rb', line 55 def self.create_group_results_from_array(count, array_pointer) (1..count).map do |index| result_pointer = (array_pointer + (index - 1)).read_pointer new(result_pointer) end end |