Allow getting Events out of Queues

This commit is contained in:
Matias Fontanini
2018-10-21 11:32:52 -07:00
parent b46991db7e
commit e73c997a0c
2 changed files with 29 additions and 5 deletions

View File

@@ -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)
*/