mirror of
				https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
				synced 2025-11-03 20:18:06 +00:00 
			
		
		
		
	Minor documentation fixes
This commit is contained in:
		@@ -376,7 +376,7 @@ public:
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * \brief Polls for a batch of messages
 | 
					     * \brief Polls for a batch of messages
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * This can return one or more messages
 | 
					     * This can return zero or more messages
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \param max_batch_size The maximum amount of messages expected
 | 
					     * \param max_batch_size The maximum amount of messages expected
 | 
				
			||||||
     * \param alloc The optionally supplied allocator for allocating messages
 | 
					     * \param alloc The optionally supplied allocator for allocating messages
 | 
				
			||||||
@@ -386,12 +386,22 @@ public:
 | 
				
			|||||||
    template <typename Allocator>
 | 
					    template <typename Allocator>
 | 
				
			||||||
    std::vector<Message, Allocator> poll_batch(size_t max_batch_size,
 | 
					    std::vector<Message, Allocator> poll_batch(size_t max_batch_size,
 | 
				
			||||||
                                               const Allocator& alloc);
 | 
					                                               const Allocator& alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * \brief Polls for a batch of messages
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * This can return zero or more messages
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \param max_batch_size The maximum amount of messages expected
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \return A list of messages
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    std::vector<Message> poll_batch(size_t max_batch_size);
 | 
					    std::vector<Message> poll_batch(size_t max_batch_size);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * \brief Polls for a batch of messages
 | 
					     * \brief Polls for a batch of messages
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * This can return one or more messages
 | 
					     * This can return zero or more messages
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \param max_batch_size The maximum amount of messages expected
 | 
					     * \param max_batch_size The maximum amount of messages expected
 | 
				
			||||||
     * \param timeout The timeout for this operation
 | 
					     * \param timeout The timeout for this operation
 | 
				
			||||||
@@ -403,6 +413,17 @@ public:
 | 
				
			|||||||
    std::vector<Message, Allocator> poll_batch(size_t max_batch_size,
 | 
					    std::vector<Message, Allocator> poll_batch(size_t max_batch_size,
 | 
				
			||||||
                                               std::chrono::milliseconds timeout,
 | 
					                                               std::chrono::milliseconds timeout,
 | 
				
			||||||
                                               const Allocator& alloc);
 | 
					                                               const Allocator& alloc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * \brief Polls for a batch of messages
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * This can return one or more messages
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \param max_batch_size The maximum amount of messages expected
 | 
				
			||||||
 | 
					     * \param timeout The timeout for this operation
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \return A list of messages
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    std::vector<Message> poll_batch(size_t max_batch_size,
 | 
					    std::vector<Message> poll_batch(size_t max_batch_size,
 | 
				
			||||||
                                    std::chrono::milliseconds timeout);
 | 
					                                    std::chrono::milliseconds timeout);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@@ -465,14 +486,18 @@ std::vector<Message, Allocator> Consumer::poll_batch(size_t max_batch_size,
 | 
				
			|||||||
    std::vector<rd_kafka_message_t*> raw_messages(max_batch_size);
 | 
					    std::vector<rd_kafka_message_t*> raw_messages(max_batch_size);
 | 
				
			||||||
    // Note that this will leak the queue when using rdkafka < 0.11.5 (see get_queue comment)
 | 
					    // Note that this will leak the queue when using rdkafka < 0.11.5 (see get_queue comment)
 | 
				
			||||||
    Queue queue(get_queue(rd_kafka_queue_get_consumer(get_handle())));
 | 
					    Queue queue(get_queue(rd_kafka_queue_get_consumer(get_handle())));
 | 
				
			||||||
    ssize_t result = rd_kafka_consume_batch_queue(queue.get_handle() , timeout.count(), raw_messages.data(),
 | 
					    ssize_t result = rd_kafka_consume_batch_queue(queue.get_handle(),
 | 
				
			||||||
 | 
					                                                  timeout.count(),
 | 
				
			||||||
 | 
					                                                  raw_messages.data(),
 | 
				
			||||||
                                                  raw_messages.size());
 | 
					                                                  raw_messages.size());
 | 
				
			||||||
    if (result == -1) {
 | 
					    if (result == -1) {
 | 
				
			||||||
        check_error(rd_kafka_last_error());
 | 
					        check_error(rd_kafka_last_error());
 | 
				
			||||||
        // on the off-chance that check_error() does not throw an error
 | 
					        // on the off-chance that check_error() does not throw an error
 | 
				
			||||||
        return std::vector<Message, Allocator>(alloc);
 | 
					        return std::vector<Message, Allocator>(alloc);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return std::vector<Message, Allocator>(raw_messages.begin(), raw_messages.begin() + result, alloc);
 | 
					    return std::vector<Message, Allocator>(raw_messages.begin(),
 | 
				
			||||||
 | 
					                                           raw_messages.begin() + result,
 | 
				
			||||||
 | 
					                                           alloc);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
} // cppkafka
 | 
					} // cppkafka
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -134,10 +134,10 @@ public:
 | 
				
			|||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * \brief Consumes a batch of messages from this queue
 | 
					     * \brief Consumes a batch of messages from this queue
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * This translates to a call to rd_kafka_consume_batch_queue using the configured timeout for this object
 | 
					     * This translates to a call to rd_kafka_consume_batch_queue using the configured timeout
 | 
				
			||||||
 | 
					     * for this object
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \param max_batch_size The max number of messages to consume if available
 | 
					     * \param max_batch_size The max number of messages to consume if available
 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * \param alloc The optionally supplied allocator for the message list
 | 
					     * \param alloc The optionally supplied allocator for the message list
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \return A list of messages. Could be empty if there's nothing to consume
 | 
					     * \return A list of messages. Could be empty if there's nothing to consume
 | 
				
			||||||
@@ -145,17 +145,27 @@ public:
 | 
				
			|||||||
    template <typename Allocator>
 | 
					    template <typename Allocator>
 | 
				
			||||||
    std::vector<Message, Allocator> consume_batch(size_t max_batch_size,
 | 
					    std::vector<Message, Allocator> consume_batch(size_t max_batch_size,
 | 
				
			||||||
                                                  const Allocator& alloc) const;
 | 
					                                                  const Allocator& alloc) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * \brief Consumes a batch of messages from this queue
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * This translates to a call to rd_kafka_consume_batch_queue using the configured timeout
 | 
				
			||||||
 | 
					     * for this object
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \param max_batch_size The max number of messages to consume if available
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \return A list of messages. Could be empty if there's nothing to consume
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    std::vector<Message> consume_batch(size_t max_batch_size) const;
 | 
					    std::vector<Message> consume_batch(size_t max_batch_size) const;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * \brief Consumes a batch of messages from this queue
 | 
					     * \brief Consumes a batch of messages from this queue
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * Same as Queue::consume_batch(size_t) but the specified timeout will be used instead of the configured one
 | 
					     * Same as Queue::consume_batch(size_t) but the specified timeout will be used instead of the
 | 
				
			||||||
 | 
					     * configured one
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \param max_batch_size The max number of messages to consume if available
 | 
					     * \param max_batch_size The max number of messages to consume if available
 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * \param timeout The timeout to be used on this call
 | 
					     * \param timeout The timeout to be used on this call
 | 
				
			||||||
     *
 | 
					 | 
				
			||||||
     * \param alloc The optionally supplied allocator for the message list
 | 
					     * \param alloc The optionally supplied allocator for the message list
 | 
				
			||||||
     *
 | 
					     *
 | 
				
			||||||
     * \return A list of messages. Could be empty if there's nothing to consume
 | 
					     * \return A list of messages. Could be empty if there's nothing to consume
 | 
				
			||||||
@@ -164,6 +174,18 @@ public:
 | 
				
			|||||||
    std::vector<Message, Allocator> consume_batch(size_t max_batch_size,
 | 
					    std::vector<Message, Allocator> consume_batch(size_t max_batch_size,
 | 
				
			||||||
                                                  std::chrono::milliseconds timeout,
 | 
					                                                  std::chrono::milliseconds timeout,
 | 
				
			||||||
                                                  const Allocator& alloc) const;
 | 
					                                                  const Allocator& alloc) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * \brief Consumes a batch of messages from this queue
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * Same as Queue::consume_batch(size_t) but the specified timeout will be used instead of the
 | 
				
			||||||
 | 
					     * configured one
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \param max_batch_size The max number of messages to consume if available
 | 
				
			||||||
 | 
					     * \param timeout The timeout to be used on this call
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * \return A list of messages. Could be empty if there's nothing to consume
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    std::vector<Message> consume_batch(size_t max_batch_size,
 | 
					    std::vector<Message> consume_batch(size_t max_batch_size,
 | 
				
			||||||
                                       std::chrono::milliseconds timeout) const;
 | 
					                                       std::chrono::milliseconds timeout) const;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user