lib/rdkafka/consumer.rb
# Atomic assignment of partitions to consume
#
# @param list [TopicPartitionList] The topic with partitions to assign
#
# @raise [RdkafkaError] When assigning fails
Atomic assignment of partitions to consume
Atomic assignment of partitions to consume
def assign(list)
      unless list.is_a?(TopicPartitionList)
        raise TypeError.new("list has to be a TopicPartitionList")
      end
      tpl = list.to_native_tpl
      response = Rdkafka::Bindings.rd_kafka_assign(@native_kafka, tpl)
      if response != 0
        raise Rdkafka::RdkafkaError.new(response, "Error assigning '#{list.to_h}'")
      end
    end
def assign ( list ) unless list . is_a? ( TopicPartitionList ) raise TypeError . new ( "list has to be a TopicPartitionList" ) end tpl = list . to_native_tpl response = Rdkafka :: Bindings . rd_kafka_assign ( @native_kafka , tpl ) if response != 0 raise Rdkafka :: RdkafkaError . new ( response , "Error assigning '#{list.to_h}'" ) end end
Atomic assignment of partitions to consume
Atomic assignment of partitions to consume
[RdkafkaError] When assigning fails
[ RdkafkaError ] When assigning fails
list
The topic with partitions to assign
The topic with partitions to assign