mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-18 18:54:50 +00:00
Allow polling with a timeout
This commit is contained in:
@@ -34,6 +34,8 @@
|
||||
using std::move;
|
||||
using std::string;
|
||||
|
||||
using std::chrono::milliseconds;
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
Producer::Producer(Configuration config)
|
||||
@@ -83,7 +85,11 @@ void Producer::produce(const Topic& topic, const Partition& partition, const Buf
|
||||
}
|
||||
|
||||
int Producer::poll() {
|
||||
return rd_kafka_poll(get_handle(), get_timeout().count());
|
||||
return poll(get_timeout());
|
||||
}
|
||||
|
||||
int Producer::poll(milliseconds timeout) {
|
||||
return rd_kafka_poll(get_handle(), timeout.count());
|
||||
}
|
||||
|
||||
} // cppkafka
|
||||
|
||||
Reference in New Issue
Block a user