Class: Karafka::BaseController
- Inherits:
-
Object
- Object
- Karafka::BaseController
- Extended by:
- ActiveSupport::DescendantsTracker
- Defined in:
- lib/karafka/base_controller.rb
Overview
Base controller from which all Karafka controllers should inherit
Class Attribute Summary collapse
-
.topic ⇒ Object
Returns the value of attribute topic.
Instance Attribute Summary collapse
-
#params_batch ⇒ Karafka::Params::ParamsBatch
writeonly
Creates lazy loaded params batch object.
Instance Method Summary collapse
-
#call ⇒ Object
Executes the default controller flow.
-
#topic ⇒ Karafka::Routing::Topic
Topic to which a given controller is subscribed.
Class Attribute Details
.topic ⇒ Object
Returns the value of attribute topic.
10 11 12 |
# File 'lib/karafka/base_controller.rb', line 10 def topic @topic end |
Instance Attribute Details
#params_batch=(messages) ⇒ Karafka::Params::ParamsBatch
Note:
Until first params usage, it won’t parse data at all
Creates lazy loaded params batch object
32 33 34 |
# File 'lib/karafka/base_controller.rb', line 32 def params_batch=() @params_batch = Karafka::Params::ParamsBatch.new(, topic.parser) end |
Instance Method Details
#call ⇒ Object
Executes the default controller flow.
37 38 39 |
# File 'lib/karafka/base_controller.rb', line 37 def call process end |
#topic ⇒ Karafka::Routing::Topic
Returns topic to which a given controller is subscribed.
23 24 25 |
# File 'lib/karafka/base_controller.rb', line 23 def topic self.class.topic end |