jai1 commented on a change in pull request #577: CPP add receiveAsync API
URL: https://github.com/apache/incubator-pulsar/pull/577#discussion_r128685465
##########
File path: pulsar-client-cpp/lib/PartitionedConsumerImpl.cc
##########
@@ -318,10 +345,44 @@ namespace pulsar {
void PartitionedConsumerImpl::messageReceived(Consumer consumer, const
Message& msg) {
Review comment:
Why not :
```
void PartitionedConsumerImpl::messageReceived(Consumer consumer, const
Message& msg) {
LOG_DEBUG("Received Message from one of the partition - " <<
msg.impl_->messageId.partition_);
Lock lock(mutex_);
if(!pendingReceives_.empty()) {
ReceiveCallback callback = pendingReceives_.front();
pendingReceives_.pop();
lock.unlock();
callback(ResultOk, msg);
unAckedMessageTrackerPtr_->add(msg.getMessageId());
return;
}
messages_.push(msg);
if (messageListener_) {
listenerExecutor_->postWork(boost::bind(&PartitionedConsumerImpl::internalListener,
shared_from_this(), consumer));
}
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services