Module: Karafka::Routing::Features::ConsumerGroups::Eofed::Topic
- Defined in:
- lib/karafka/routing/features/consumer_groups/eofed/topic.rb
Overview
Routing topic eofed API
Instance Method Summary collapse
- #eofed(active = false) ⇒ Object
-
#eofed? ⇒ Boolean
Are ‘#eofed` jobs active.
-
#initialize ⇒ Object
This method sets up the extra instance variable to nil before calling the parent class initializer.
-
#to_h ⇒ Hash
Topic setup hash.
Instance Method Details
#eofed(active = false) ⇒ Object
20 21 22 23 24 |
# File 'lib/karafka/routing/features/consumer_groups/eofed/topic.rb', line 20 def eofed(active = false) @eofed ||= Config.new( active: active ) end |
#eofed? ⇒ Boolean
Returns Are ‘#eofed` jobs active.
27 28 29 |
# File 'lib/karafka/routing/features/consumer_groups/eofed/topic.rb', line 27 def eofed? eofed.active? end |
#initialize ⇒ Object
This method sets up the extra instance variable to nil before calling the parent class initializer. The explicit initialization to nil is included as an optimization for Ruby’s object shapes system, which improves memory layout and access performance.
14 15 16 17 |
# File 'lib/karafka/routing/features/consumer_groups/eofed/topic.rb', line 14 def initialize(...) @eofed = nil super end |
#to_h ⇒ Hash
Returns topic setup hash.
32 33 34 35 36 |
# File 'lib/karafka/routing/features/consumer_groups/eofed/topic.rb', line 32 def to_h super.merge( eofed: eofed.to_h ).freeze end |