Class: Rdkafka::Callbacks::TopicResult
- Inherits:
-
Object
- Object
- Rdkafka::Callbacks::TopicResult
- Defined in:
- lib/rdkafka/callbacks.rb
Overview
Extracts attributes of a rd_kafka_topic_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_topic_results_from_array(count, array_pointer) ⇒ Array<TopicResult>
Array of topic results.
Instance Method Summary collapse
-
#initialize(topic_result_pointer) ⇒ TopicResult
constructor
A new instance of TopicResult.
Constructor Details
#initialize(topic_result_pointer) ⇒ TopicResult
Returns a new instance of TopicResult.
14 15 16 17 18 |
# File 'lib/rdkafka/callbacks.rb', line 14 def initialize(topic_result_pointer) @result_error = Rdkafka::Bindings.rd_kafka_topic_result_error(topic_result_pointer) @error_string = Rdkafka::Bindings.rd_kafka_topic_result_error_string(topic_result_pointer) @result_name = Rdkafka::Bindings.rd_kafka_topic_result_name(topic_result_pointer) end |
Instance Attribute Details
#error_string ⇒ Object (readonly)
Returns the value of attribute error_string.
11 12 13 |
# File 'lib/rdkafka/callbacks.rb', line 11 def error_string @error_string end |
#result_error ⇒ Object (readonly)
Returns the value of attribute result_error.
11 12 13 |
# File 'lib/rdkafka/callbacks.rb', line 11 def result_error @result_error end |
#result_name ⇒ Object (readonly)
Returns the value of attribute result_name.
11 12 13 |
# File 'lib/rdkafka/callbacks.rb', line 11 def result_name @result_name end |
Class Method Details
.create_topic_results_from_array(count, array_pointer) ⇒ Array<TopicResult>
Returns array of topic results.
23 24 25 26 27 28 |
# File 'lib/rdkafka/callbacks.rb', line 23 def self.create_topic_results_from_array(count, array_pointer) (1..count).map do |index| result_pointer = (array_pointer + (index - 1)).read_pointer new(result_pointer) end end |