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