h-j-13 commented on issue #8869:
URL: https://github.com/apache/pulsar/issues/8869#issuecomment-742217933


   > Use lambda capture
   > 
   > ```c++
   > consumer.receiveAsync([&consumer](Result code, const Message& msg) {
   >     // process `code` and `msg`...
   >     consumer.acknowledge(msg);
   > });
   > ```
   
   Thx, it worked.  But I still think that the parameters of the callback 
function should be updated like
   ```c
   typedef std::function<void(Consumer consumer, Result, const Message& msg)> 
ReceiveCallback;
   ```
   to keep the code style uniform


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to