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.



419
420
421
# File 'lib/rdkafka/config.rb', line 419

def consumer_rebalance_listener
  @consumer_rebalance_listener
end

#producerObject

Returns the value of attribute producer.



418
419
420
# File 'lib/rdkafka/config.rb', line 418

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:



424
425
426
# File 'lib/rdkafka/config.rb', line 424

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:



430
431
432
433
434
435
# File 'lib/rdkafka/config.rb', line 430

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:



439
440
441
442
443
444
# File 'lib/rdkafka/config.rb', line 439

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