Class: Karafka::Pro::Routing::Features::Patterns::Patterns
- Inherits:
-
Routing::Topics
- Object
- Routing::Topics
- Karafka::Pro::Routing::Features::Patterns::Patterns
- Defined in:
- lib/karafka/pro/routing/features/patterns/patterns.rb
Overview
Representation of groups of topics
Instance Method Summary collapse
-
#find(topic_name) ⇒ Karafka::Routing::Pattern?
Finds first pattern matching given topic name.
Methods inherited from Routing::Topics
#delete_if, #each, #initialize
Constructor Details
This class inherits a constructor from Karafka::Routing::Topics
Instance Method Details
#find(topic_name) ⇒ Karafka::Routing::Pattern?
Note:
Please keep in mind, that there may be many patterns matching given topic name and we always pick the first one (defined first)
Finds first pattern matching given topic name
27 28 29 |
# File 'lib/karafka/pro/routing/features/patterns/patterns.rb', line 27 def find(topic_name) @accumulator.find { |pattern| pattern.regexp =~ topic_name } end |