Class: WaterDrop::Producer::DummyClient
- Inherits:
-
Object
- Object
- WaterDrop::Producer::DummyClient
- Defined in:
- lib/waterdrop/producer/dummy_client.rb
Overview
A dummy client that is supposed to be used instead of Rdkafka::Producer in case we don’t want to dispatch anything to Kafka
Instance Method Summary collapse
-
#initialize ⇒ DummyClient
constructor
Dummy instance.
-
#method_missing(*_args) ⇒ self
Returns self for chaining cases.
- #respond_to_missing?(*_args) ⇒ Boolean
-
#wait(*_args) ⇒ ::Rdkafka::Producer::DeliveryReport
Dummy method for returning the delivery report.
Constructor Details
#initialize ⇒ DummyClient
Returns dummy instance.
9 10 11 |
# File 'lib/waterdrop/producer/dummy_client.rb', line 9 def initialize @counter = -1 end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*_args) ⇒ self
Returns self for chaining cases
27 28 29 |
# File 'lib/waterdrop/producer/dummy_client.rb', line 27 def method_missing(*_args) self || super end |
Instance Method Details
#respond_to_missing?(*_args) ⇒ Boolean
21 22 23 |
# File 'lib/waterdrop/producer/dummy_client.rb', line 21 def respond_to_missing?(*_args) true end |
#wait(*_args) ⇒ ::Rdkafka::Producer::DeliveryReport
Dummy method for returning the delivery report
16 17 18 |
# File 'lib/waterdrop/producer/dummy_client.rb', line 16 def wait(*_args) ::Rdkafka::Producer::DeliveryReport.new(0, @counter += 1) end |