Class: WaterDrop::Instrumentation::Callbacks::Delivery
- Inherits:
-
Object
- Object
- WaterDrop::Instrumentation::Callbacks::Delivery
- Defined in:
- lib/water_drop/instrumentation/callbacks/delivery.rb
Overview
Note:
We don’t have to provide client_name here as this callback is per client instance
Creates a callable that we want to run upon each message delivery or failure
Instance Method Summary collapse
-
#call(delivery_report) ⇒ Object
Emits delivery details to the monitor.
-
#initialize(producer_id, monitor) ⇒ Delivery
constructor
A new instance of Delivery.
Constructor Details
#initialize(producer_id, monitor) ⇒ Delivery
Returns a new instance of Delivery.
12 13 14 15 |
# File 'lib/water_drop/instrumentation/callbacks/delivery.rb', line 12 def initialize(producer_id, monitor) @producer_id = producer_id @monitor = monitor end |
Instance Method Details
#call(delivery_report) ⇒ Object
Emits delivery details to the monitor
19 20 21 22 23 24 25 26 |
# File 'lib/water_drop/instrumentation/callbacks/delivery.rb', line 19 def call(delivery_report) @monitor.instrument( 'message.acknowledged', producer_id: @producer_id, offset: delivery_report.offset, partition: delivery_report.partition ) end |