lib/rdkafka/consumer.rb
def assignment
      tpl = FFI::MemoryPointer.new(:pointer)
      response = Rdkafka::Bindings.rd_kafka_assignment(@native_kafka, tpl)
      if response != 0
        raise Rdkafka::RdkafkaError.new(response)
      end

      tpl = tpl.read(:pointer).tap { |it| it.autorelease = false  }

      begin
        Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
      ensure
        Rdkafka::Bindings.rd_kafka_topic_partition_list_destroy tpl
      end
    end
# Returns the current partition assignment.
#
# @raise [RdkafkaError] When getting the assignment fails.
#
# @return [TopicPartitionList]
Returns the current partition assignment.
Returns the current partition assignment .
def assignment
      tpl = FFI::MemoryPointer.new(:pointer)
      response = Rdkafka::Bindings.rd_kafka_assignment(@native_kafka, tpl)
      if response != 0
        raise Rdkafka::RdkafkaError.new(response)
      end
      tpl = tpl.read(:pointer).tap { |it| it.autorelease = false  }
      begin
        Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
      ensure
        Rdkafka::Bindings.rd_kafka_topic_partition_list_destroy tpl
      end
    end
def assignment tpl = FFI :: MemoryPointer . new ( :pointer ) response = Rdkafka :: Bindings . rd_kafka_assignment ( @native_kafka , tpl ) if response != 0 raise Rdkafka :: RdkafkaError . new ( response ) end tpl = tpl . read ( :pointer ) . tap { | it | it . autorelease = false } begin Rdkafka :: Consumer :: TopicPartitionList . from_native_tpl ( tpl ) ensure Rdkafka :: Bindings . rd_kafka_topic_partition_list_destroy tpl end end
Returns the current partition assignment.
Returns the current partition assignment .
None
TopicPartitionList
[RdkafkaError] When getting the assignment fails.
[ RdkafkaError ] When getting the assignment fails .