mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-02 11:37:50 +00:00
Allow getting Events out of Queues
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <memory>
|
||||
#include <boost/optional.hpp>
|
||||
#include <librdkafka/rdkafka.h>
|
||||
#include "event.h"
|
||||
#include "macros.h"
|
||||
#include "message.h"
|
||||
|
||||
@@ -130,7 +131,7 @@ public:
|
||||
* \return A message
|
||||
*/
|
||||
Message consume(std::chrono::milliseconds timeout) const;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Consumes a batch of messages from this queue
|
||||
*
|
||||
@@ -188,7 +189,23 @@ public:
|
||||
*/
|
||||
std::vector<Message> consume_batch(size_t max_batch_size,
|
||||
std::chrono::milliseconds timeout) const;
|
||||
|
||||
|
||||
/**
|
||||
* \brief Extracts the next message in this Queue
|
||||
*
|
||||
* /return The latest event, if any
|
||||
*/
|
||||
Event next_event() const;
|
||||
|
||||
/**
|
||||
* \brief Extracts the next message in this Queue
|
||||
*
|
||||
* \param timeout The amount of time to wait for this operation to complete
|
||||
*
|
||||
* /return The latest event, if any
|
||||
*/
|
||||
Event next_event(std::chrono::milliseconds timeout) const;
|
||||
|
||||
/**
|
||||
* Indicates whether this queue is valid (not null)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user