Module: Karafka::Pro::Routing::Features::Filtering::Topic
- Defined in:
- lib/karafka/pro/routing/features/filtering/topic.rb
Overview
Filtering feature topic extensions
Instance Method Summary collapse
- #filter(factory = nil) ⇒ Object
-
#filtering(*args) ⇒ Filtering::Config
Alias to match the naming API for features.
-
#filtering? ⇒ Boolean
Is a given job throttled.
-
#to_h ⇒ Hash
Topic with all its native configuration options plus throttling.
Instance Method Details
#filter(factory = nil) ⇒ Object
23 24 25 26 27 |
# File 'lib/karafka/pro/routing/features/filtering/topic.rb', line 23 def filter(factory = nil) @filtering ||= Config.new(factories: []) @filtering.factories << factory if factory @filtering end |
#filtering(*args) ⇒ Filtering::Config
Returns alias to match the naming API for features.
31 32 33 |
# File 'lib/karafka/pro/routing/features/filtering/topic.rb', line 31 def filtering(*args) filter(*args) end |
#filtering? ⇒ Boolean
Returns is a given job throttled.
36 37 38 |
# File 'lib/karafka/pro/routing/features/filtering/topic.rb', line 36 def filtering? filtering.active? end |
#to_h ⇒ Hash
Returns topic with all its native configuration options plus throttling.
41 42 43 44 45 |
# File 'lib/karafka/pro/routing/features/filtering/topic.rb', line 41 def to_h super.merge( filtering: filtering.to_h ).freeze end |