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.



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

def consumer_rebalance_listener
  @consumer_rebalance_listener
end

#producerObject

Returns the value of attribute producer.



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

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:



436
437
438
# File 'lib/rdkafka/config.rb', line 436

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:



442
443
444
445
446
447
# File 'lib/rdkafka/config.rb', line 442

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:



451
452
453
454
455
456
# File 'lib/rdkafka/config.rb', line 451

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