Class: Racecar::RebalanceListener::Event
- Inherits:
-
Object
- Object
- Racecar::RebalanceListener::Event
- Defined in:
- lib/racecar/rebalance_listener.rb
Instance Attribute Summary collapse
-
#__rdkafka_consumer ⇒ Object
readonly
API private and not guaranteed stable.
-
#__rdkafka_topic_partition_list ⇒ Object
readonly
API private and not guaranteed stable.
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(rdkafka_topic_partition_list:, rdkafka_consumer:) ⇒ Event
constructor
A new instance of Event.
- #partition_numbers ⇒ Object
- #topic_name ⇒ Object
Constructor Details
#initialize(rdkafka_topic_partition_list:, rdkafka_consumer:) ⇒ Event
Returns a new instance of Event.
37 38 39 40 |
# File 'lib/racecar/rebalance_listener.rb', line 37 def initialize(rdkafka_topic_partition_list:, rdkafka_consumer:) @__rdkafka_topic_partition_list = rdkafka_topic_partition_list @__rdkafka_consumer = rdkafka_consumer end |
Instance Attribute Details
#__rdkafka_consumer ⇒ Object (readonly)
API private and not guaranteed stable
55 56 57 |
# File 'lib/racecar/rebalance_listener.rb', line 55 def __rdkafka_consumer @__rdkafka_consumer end |
#__rdkafka_topic_partition_list ⇒ Object (readonly)
API private and not guaranteed stable
55 56 57 |
# File 'lib/racecar/rebalance_listener.rb', line 55 def __rdkafka_topic_partition_list @__rdkafka_topic_partition_list end |
Instance Method Details
#empty? ⇒ Boolean
50 51 52 |
# File 'lib/racecar/rebalance_listener.rb', line 50 def empty? __rdkafka_topic_partition_list.empty? end |
#partition_numbers ⇒ Object
46 47 48 |
# File 'lib/racecar/rebalance_listener.rb', line 46 def partition_numbers __rdkafka_topic_partition_list.to_h.values.flatten.map(&:partition) end |
#topic_name ⇒ Object
42 43 44 |
# File 'lib/racecar/rebalance_listener.rb', line 42 def topic_name __rdkafka_topic_partition_list.to_h.keys.first end |