Class: Rdkafka::Opaque

Inherits:
Object
  • Object
show all
Defined in:
lib/rdkafka/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#consumer_rebalance_listenerObject

Returns the value of attribute consumer_rebalance_listener.



380
381
382
# File 'lib/rdkafka/config.rb', line 380

def consumer_rebalance_listener
  @consumer_rebalance_listener
end

#producerObject

Returns the value of attribute producer.



379
380
381
# File 'lib/rdkafka/config.rb', line 379

def producer
  @producer
end

Instance Method Details

#call_delivery_callback(delivery_report, delivery_handle) ⇒ Object

Invokes the delivery callback on the producer if one is set

Parameters:



385
386
387
# File 'lib/rdkafka/config.rb', line 385

def call_delivery_callback(delivery_report, delivery_handle)
  producer&.call_delivery_callback(delivery_report, delivery_handle)
end

#call_on_partitions_assigned(list) ⇒ Object

Invokes the on_partitions_assigned callback on the rebalance listener if set

Parameters:



391
392
393
394
395
396
# File 'lib/rdkafka/config.rb', line 391

def call_on_partitions_assigned(list)
  return unless consumer_rebalance_listener
  return unless consumer_rebalance_listener.respond_to?(:on_partitions_assigned)

  consumer_rebalance_listener.on_partitions_assigned(list)
end

#call_on_partitions_revoked(list) ⇒ Object

Invokes the on_partitions_revoked callback on the rebalance listener if set

Parameters:



400
401
402
403
404
405
# File 'lib/rdkafka/config.rb', line 400

def call_on_partitions_revoked(list)
  return unless consumer_rebalance_listener
  return unless consumer_rebalance_listener.respond_to?(:on_partitions_revoked)

  consumer_rebalance_listener.on_partitions_revoked(list)
end