Class: Karafka::Testing::SpecProducerClient
- Inherits:
-
WaterDrop::Clients::Buffered
- Object
- WaterDrop::Clients::Buffered
- Karafka::Testing::SpecProducerClient
- Defined in:
- lib/karafka/testing/spec_producer_client.rb
Overview
Spec producer client used to buffer messages that we send out in specs
Instance Method Summary collapse
-
#initialize(rspec) ⇒ SpecProducerClient
constructor
A new instance of SpecProducerClient.
-
#produce(message) ⇒ Object
“Produces” message to Kafka.
Constructor Details
#initialize(rspec) ⇒ SpecProducerClient
Returns a new instance of SpecProducerClient.
9 10 11 12 |
# File 'lib/karafka/testing/spec_producer_client.rb', line 9 def initialize(rspec) super(nil) @rspec = rspec end |
Instance Method Details
#produce(message) ⇒ Object
“Produces” message to Kafka. That is, it acknowledges it locally, adds it to the internal buffer and adds it (if needed) into the current consumer messages buffer
17 18 19 20 21 |
# File 'lib/karafka/testing/spec_producer_client.rb', line 17 def produce() @rspec.() super end |