equanz commented on code in PR #17452:
URL: https://github.com/apache/pulsar/pull/17452#discussion_r964357492


##########
pulsar-client-cpp/lib/c/c_Consumer.cc:
##########
@@ -60,6 +60,20 @@ pulsar_result 
pulsar_consumer_receive_with_timeout(pulsar_consumer_t *consumer,
     return (pulsar_result)res;
 }
 
+static void handle_receive_callback(pulsar::Result result, pulsar::Message 
message,
+                                    pulsar_receive_callback callback, void 
*ctx) {
+    if (callback) {
+        pulsar_message_t *msg = new pulsar_message_t;
+        msg->message = message;
+        callback((pulsar_result)result, msg, ctx);

Review Comment:
   In my understanding, other async functions are also defined by the current 
approach.
   
https://github.com/apache/pulsar/blob/a7f1a5657782ff7ac91a89afdd49568d74d111f5/pulsar-client-cpp/lib/c/c_Producer.cc#L39-L55
   
   I think it is better not to change semantics in the same C API.



-- 
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]

Reply via email to