RobertIndie commented on code in PR #309:
URL:
https://github.com/apache/pulsar-client-node/pull/309#discussion_r1161663473
##########
src/Consumer.cc:
##########
@@ -82,9 +96,14 @@ void MessageListener(pulsar_consumer_t *rawConsumer,
pulsar_message_t *rawMessag
return;
}
- MessageListenerProxyData *dataPtr = new MessageListenerProxyData(cMessage,
consumer);
- listenerCallback->callback.BlockingCall(dataPtr, MessageListenerProxy);
+ std::promise<void> promise;
+ std::future<void> future = promise.get_future();
+ std::unique_ptr<MessageListenerProxyData> dataPtr =
std::unique_ptr<MessageListenerProxyData>(
+ new MessageListenerProxyData(cMessage, consumer, [&promise]() {
promise.set_value(); }));
Review Comment:
Looks better. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]