RobertIndie commented on code in PR #71:
URL: https://github.com/apache/pulsar-client-cpp/pull/71#discussion_r1007627774


##########
lib/ConsumerImpl.cc:
##########
@@ -319,6 +320,31 @@ void ConsumerImpl::unsubscribeAsync(ResultCallback 
originalCallback) {
     }
 }
 
+void ConsumerImpl::triggerCheckExpiredChunkedTimer() {
+    checkExpiredChunkedTimer_->expires_from_now(
+        
boost::posix_time::milliseconds(expireTimeOfIncompleteChunkedMessageMs_));
+    std::weak_ptr<ConsumerImplBase> weakSelf{shared_from_this()};
+    checkExpiredChunkedTimer_->async_wait([this, weakSelf](const 
boost::system::error_code& ec) -> void {

Review Comment:
   I think it's okay for the current approach. The weak_ptr is already captured 
in the callback. I think we don't need to `dynamic_pointer_cast` the shared_ptr 
here. This approach has the same effect.
   
   You can refer here: 
https://github.com/apache/pulsar-client-cpp/blob/2248adcfdf23682221e36bf784287ce325589f2f/lib/RetryableLookupService.h#L131-L132



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