Class: Dionysus::Producer::BaseResponder
- Inherits:
-
Object
- Object
- Dionysus::Producer::BaseResponder
- Defined in:
- lib/dionysus/producer/base_responder.rb
Overview
Based on the responder concept from Karafka 1.4
Class Attribute Summary collapse
-
.topics ⇒ Object
Returns the value of attribute topics.
Instance Attribute Summary collapse
-
#messages_buffer ⇒ Object
readonly
Returns the value of attribute messages_buffer.
Class Method Summary collapse
Instance Method Summary collapse
- #call(*data) ⇒ Object
-
#initialize ⇒ BaseResponder
constructor
A new instance of BaseResponder.
Constructor Details
#initialize ⇒ BaseResponder
Returns a new instance of BaseResponder.
20 21 22 |
# File 'lib/dionysus/producer/base_responder.rb', line 20 def initialize @messages_buffer = Hash.new { |h, k| h[k] = [] } end |
Class Attribute Details
.topics ⇒ Object
Returns the value of attribute topics.
6 7 8 |
# File 'lib/dionysus/producer/base_responder.rb', line 6 def topics @topics end |
Instance Attribute Details
#messages_buffer ⇒ Object (readonly)
Returns the value of attribute messages_buffer.
18 19 20 |
# File 'lib/dionysus/producer/base_responder.rb', line 18 def @messages_buffer end |
Class Method Details
.call(*data) ⇒ Object
13 14 15 |
# File 'lib/dionysus/producer/base_responder.rb', line 13 def call(*data) new.call(*data) end |
.topic(topic_name) ⇒ Object
8 9 10 11 |
# File 'lib/dionysus/producer/base_responder.rb', line 8 def topic(topic_name) self.topics ||= {} self.topics[topic_name] = topic_name.to_s end |
Instance Method Details
#call(*data) ⇒ Object
24 25 26 27 |
# File 'lib/dionysus/producer/base_responder.rb', line 24 def call(*data) respond(*data) deliver end |