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

 @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 comitting fails

 @return [nil]