lib/rdkafka/consumer.rb
def commit(list=nil, async=false)
      if !list.nil? && !list.is_a?(TopicPartitionList)
        raise TypeError.new("list has to be nil or a TopicPartitionList")
      end
      tpl = if list
              list.to_native_tpl
            else
              nil
            end
      response = Rdkafka::Bindings.rd_kafka_commit(@native_kafka, tpl, async)
      if response != 0
        raise Rdkafka::RdkafkaError.new(response)
      end
    end
# Commit the current offsets of this consumer
#
# @param list [TopicPartitionList,nil] The topic with partitions to commit
# @param async [Boolean] Whether to commit async or wait for the commit to finish
#
# @raise [RdkafkaError] When committing fails
#
# @return [nil]
Commit the current offsets of this consumer
Commit the current offsets of this consumer
def commit(list=nil, async=false)
      if !list.nil? && !list.is_a?(TopicPartitionList)
        raise TypeError.new("list has to be nil or a TopicPartitionList")
      end
      tpl = if list
              list.to_native_tpl
            else
              nil
            end
      response = Rdkafka::Bindings.rd_kafka_commit(@native_kafka, tpl, async)
      if response != 0
        raise Rdkafka::RdkafkaError.new(response)
      end
    end
def commit ( list = nil , async = false ) if ! list . nil? && ! list . is_a? ( TopicPartitionList ) raise TypeError . new ( "list has to be nil or a TopicPartitionList" ) end tpl = if list list . to_native_tpl else nil end response = Rdkafka :: Bindings . rd_kafka_commit ( @native_kafka , tpl , async ) if response != 0 raise Rdkafka :: RdkafkaError . new ( response ) end end
Commit the current offsets of this consumer
Commit the current offsets of this consumer
None
nil
[RdkafkaError] When committing fails
[ RdkafkaError ] When committing fails
list
The topic with partitions to commit
The topic with partitions to commit
async
Whether to commit async or wait for the commit to finish
Whether to commit async or wait for the commit to finish