Module: Karafka::Processing::Strategies::Base
- Included in:
- Karafka::Pro::Processing::Strategies::Base, Default
- Defined in:
- lib/karafka/processing/strategies/base.rb
Overview
Base strategy that should be included in each strategy, just to ensure the API
Instance Method Summary collapse
-
#handle_after_consume ⇒ Object
Post-consumption handling.
-
#handle_before_consume ⇒ Object
What should happen before we kick in the processing.
-
#handle_before_enqueue ⇒ Object
What should happen before jobs are enqueued.
-
#handle_consume ⇒ Object
What should happen in the processing.
-
#handle_revoked ⇒ Object
Revocation handling.
-
#handle_shutdown ⇒ Object
Shutdown handling.
Instance Method Details
#handle_after_consume ⇒ Object
Post-consumption handling
31 32 33 |
# File 'lib/karafka/processing/strategies/base.rb', line 31 def handle_after_consume raise NotImplementedError, 'Implement in a subclass' end |
#handle_before_consume ⇒ Object
What should happen before we kick in the processing
21 22 23 |
# File 'lib/karafka/processing/strategies/base.rb', line 21 def handle_before_consume raise NotImplementedError, 'Implement in a subclass' end |
#handle_before_enqueue ⇒ Object
Note:
This runs from the listener thread, not recommended to put anything slow here
What should happen before jobs are enqueued
16 17 18 |
# File 'lib/karafka/processing/strategies/base.rb', line 16 def handle_before_enqueue raise NotImplementedError, 'Implement in a subclass' end |
#handle_consume ⇒ Object
What should happen in the processing
26 27 28 |
# File 'lib/karafka/processing/strategies/base.rb', line 26 def handle_consume raise NotImplementedError, 'Implement in a subclass' end |
#handle_revoked ⇒ Object
Revocation handling
36 37 38 |
# File 'lib/karafka/processing/strategies/base.rb', line 36 def handle_revoked raise NotImplementedError, 'Implement in a subclass' end |
#handle_shutdown ⇒ Object
Shutdown handling
41 42 43 |
# File 'lib/karafka/processing/strategies/base.rb', line 41 def handle_shutdown raise NotImplementedError, 'Implement in a subclass' end |