shibd commented on code in PR #16969:
URL: https://github.com/apache/pulsar/pull/16969#discussion_r955758753


##########
pulsar-client-cpp/lib/MultiTopicsConsumerImpl.cc:
##########
@@ -711,3 +735,82 @@ uint64_t 
MultiTopicsConsumerImpl::getNumberOfConnectedConsumer() {
     });
     return numberOfConnectedConsumer;
 }
+void MultiTopicsConsumerImpl::runPartitionUpdateTask() {
+    partitionsUpdateTimer_->expires_from_now(partitionsUpdateInterval_);
+    auto self = shared_from_this();
+    partitionsUpdateTimer_->async_wait([self](const boost::system::error_code& 
ec) {
+        // If two requests call runPartitionUpdateTask at the same time, the 
timer will fail, and it
+        // cannot continue at this time, and the request needs to be ignored.
+        if (!ec) {
+            self->topicPartitionUpdate();
+        }
+    });
+}
+void MultiTopicsConsumerImpl::topicPartitionUpdate() {
+    using namespace std::placeholders;
+    for (const auto& item : topicsPartitions_) {

Review Comment:
   Agree. I changed it, 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]

Reply via email to