mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-02 03:28:01 +00:00
Allocators (#118)
* Added allocator support for consumers and buffered producer * Changed MessageList back to std::vector<Message> for consistency with the allocator API
This commit is contained in:
committed by
Matias Fontanini
parent
d77e7466b8
commit
9af4330c6d
@@ -48,9 +48,9 @@ public:
|
||||
void delete_polling_strategy();
|
||||
Message poll();
|
||||
Message poll(std::chrono::milliseconds timeout);
|
||||
MessageList poll_batch(size_t max_batch_size);
|
||||
MessageList poll_batch(size_t max_batch_size,
|
||||
std::chrono::milliseconds timeout);
|
||||
std::vector<Message> poll_batch(size_t max_batch_size);
|
||||
std::vector<Message> poll_batch(size_t max_batch_size,
|
||||
std::chrono::milliseconds timeout);
|
||||
void set_timeout(std::chrono::milliseconds timeout);
|
||||
std::chrono::milliseconds get_timeout();
|
||||
private:
|
||||
|
||||
@@ -19,7 +19,6 @@ using cppkafka::Consumer;
|
||||
using cppkafka::BasicConsumerDispatcher;
|
||||
|
||||
using cppkafka::Message;
|
||||
using cppkafka::MessageList;
|
||||
using cppkafka::TopicPartition;
|
||||
|
||||
//==================================================================================
|
||||
@@ -89,7 +88,7 @@ BasicConsumerRunner<ConsumerType>::~BasicConsumerRunner() {
|
||||
}
|
||||
|
||||
template <typename ConsumerType>
|
||||
const MessageList& BasicConsumerRunner<ConsumerType>::get_messages() const {
|
||||
const std::vector<Message>& BasicConsumerRunner<ConsumerType>::get_messages() const {
|
||||
return messages_;
|
||||
}
|
||||
|
||||
@@ -135,7 +134,7 @@ Message PollStrategyAdapter::poll(milliseconds timeout) {
|
||||
}
|
||||
|
||||
inline
|
||||
MessageList PollStrategyAdapter::poll_batch(size_t max_batch_size) {
|
||||
std::vector<Message> PollStrategyAdapter::poll_batch(size_t max_batch_size) {
|
||||
if (strategy_) {
|
||||
return strategy_->poll_batch(max_batch_size);
|
||||
}
|
||||
@@ -143,8 +142,8 @@ MessageList PollStrategyAdapter::poll_batch(size_t max_batch_size) {
|
||||
}
|
||||
|
||||
inline
|
||||
MessageList PollStrategyAdapter::poll_batch(size_t max_batch_size,
|
||||
milliseconds timeout) {
|
||||
std::vector<Message> PollStrategyAdapter::poll_batch(size_t max_batch_size,
|
||||
milliseconds timeout) {
|
||||
if (strategy_) {
|
||||
return strategy_->poll_batch(max_batch_size, timeout);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user