Class: Rdkafka::Producer::DeliveryHandle
- Inherits:
 - 
      AbstractHandle
      
        
- Object
 - FFI::Struct
 - AbstractHandle
 - Rdkafka::Producer::DeliveryHandle
 
 
- Defined in:
 - lib/rdkafka/producer/delivery_handle.rb
 
Overview
Handle to wait for a delivery report which is returned when producing a message.
Constant Summary
Constants inherited from AbstractHandle
Instance Attribute Summary collapse
- 
  
    
      #label  ⇒ Object? 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Label set during message production or nil by default.
 - 
  
    
      #topic  ⇒ String 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
We use this instead of reading from
topic_namepointer to save on memory allocations. 
Instance Method Summary collapse
- 
  
    
      #create_result  ⇒ DeliveryReport 
    
    
  
  
  
  
  
  
  
  
  
    
A report on the delivery of the message.
 - 
  
    
      #operation_name  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
The name of the operation (e.g. “delivery”).
 
Methods inherited from AbstractHandle
#initialize, #pending?, #raise_error, register, remove, #unlock, #wait
Methods included from Helpers::Time
Constructor Details
This class inherits a constructor from Rdkafka::AbstractHandle
Instance Attribute Details
#label ⇒ Object?
Returns label set during message production or nil by default.
      15 16 17  | 
    
      # File 'lib/rdkafka/producer/delivery_handle.rb', line 15 def label @label end  | 
  
#topic ⇒ String
We use this instead of reading from topic_name pointer to save on memory allocations
      19 20 21  | 
    
      # File 'lib/rdkafka/producer/delivery_handle.rb', line 19 def topic @topic end  | 
  
Instance Method Details
#create_result ⇒ DeliveryReport
Returns a report on the delivery of the message.
      27 28 29 30 31 32 33 34 35 36 37  | 
    
      # File 'lib/rdkafka/producer/delivery_handle.rb', line 27 def create_result DeliveryReport.new( self[:partition], self[:offset], # For part of errors, we will not get a topic name reference and in cases like this # we should not return it topic, self[:response] != 0 ? RdkafkaError.new(self[:response]) : nil, label ) end  | 
  
#operation_name ⇒ String
Returns the name of the operation (e.g. “delivery”).
      22 23 24  | 
    
      # File 'lib/rdkafka/producer/delivery_handle.rb', line 22 def operation_name "delivery" end  |