Add wrapper for rd_kafka_outq_len

This commit is contained in:
Matias Fontanini
2016-10-08 10:24:15 -07:00
parent a46896790b
commit 23f151175d
2 changed files with 11 additions and 0 deletions

View File

@@ -166,6 +166,13 @@ public:
* Gets the handle's configuration * Gets the handle's configuration
*/ */
const Configuration& get_configuration() const; const Configuration& get_configuration() const;
/**
* \brief Gets the length of the out queue
*
* This calls rd_kafka_outq_len
*/
int get_out_queue_length() const;
protected: protected:
KafkaHandleBase(Configuration config); KafkaHandleBase(Configuration config);

View File

@@ -131,6 +131,10 @@ const Configuration& KafkaHandleBase::get_configuration() const {
return config_; return config_;
} }
int KafkaHandleBase::get_out_queue_length() const {
return rd_kafka_outq_len(handle_.get());
}
void KafkaHandleBase::set_handle(rd_kafka_t* handle) { void KafkaHandleBase::set_handle(rd_kafka_t* handle) {
handle_ = HandlePtr(handle, &rd_kafka_destroy); handle_ = HandlePtr(handle, &rd_kafka_destroy);
} }