Module: Karafka::Pro::Processing::ConsumerGroups::Filters::Actions
- Included in:
- Coordinators::FiltersApplier, Base
- Defined in:
- lib/karafka/pro/processing/consumer_groups/filters/actions.rb
Overview
Single source of truth for the post-filtering actions. Exposes each action as a method
(so filters and internal code can return Actions.pause instead of the raw :pause
symbol), the full ALL list, and the #skip? / #pause? / #seek? predicate helpers
built on top of #action. The predicates are mixed into both individual filters
(Filters::Base) and the aggregating Coordinators::FiltersApplier, so both expose the
same API instead of comparing the #action symbol directly. The returned values are the
plain symbols, so filters that still return :skip/:pause/:seek directly keep
working.
Constant Summary collapse
- ALL =
All the actions a filter's
#action(or the aggregated applier#action) can return [skip, pause, seek].freeze
Class Method Summary collapse
-
.pause ⇒ Symbol
Back off the partition and continue later.
-
.seek ⇒ Symbol
Move the partition offset without pausing.
-
.skip ⇒ Symbol
The filter did not alter the consumption flow.
Instance Method Summary collapse
-
#pause? ⇒ Boolean
Should we pause the partition.
-
#seek? ⇒ Boolean
Should we seek the partition.
-
#skip? ⇒ Boolean
Should we skip without pausing or seeking.
Class Method Details
.pause ⇒ Symbol
52 53 54 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 52 def pause :pause end |
.seek ⇒ Symbol
57 58 59 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 57 def seek :seek end |
.skip ⇒ Symbol
47 48 49 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 47 def skip :skip end |
Instance Method Details
#pause? ⇒ Boolean
71 72 73 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 71 def pause? action == Actions.pause end |
#seek? ⇒ Boolean
76 77 78 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 76 def seek? action == Actions.seek end |
#skip? ⇒ Boolean
66 67 68 |
# File 'lib/karafka/pro/processing/consumer_groups/filters/actions.rb', line 66 def skip? action == Actions.skip end |