Demogorgon314 commented on code in PR #17209:
URL: https://github.com/apache/pulsar/pull/17209#discussion_r965602993


##########
pulsar-client-cpp/lib/ConsumerImpl.cc:
##########
@@ -1380,4 +1365,52 @@ bool ConsumerImpl::isConnected() const { return 
!getCnx().expired() && state_ ==
 
 uint64_t ConsumerImpl::getNumberOfConnectedConsumer() { return isConnected() ? 
1 : 0; }
 
+void ConsumerImpl::seekAsyncInternal(long requestId, SharedBuffer seek, const 
MessageId& seekId,
+                                     long timestamp, ResultCallback callback) {
+    ClientConnectionPtr cnx = getCnx().lock();
+    if (!cnx) {
+        LOG_ERROR(getName() << " Client Connection not ready for Consumer");
+        callback(ResultNotConnected);
+        return;
+    }
+
+    const auto originalSeekMessageId = seekMessageId_.get();
+    seekMessageId_ = seekId;
+    duringSeek_ = true;
+    if (timestamp > 0) {
+        LOG_INFO(getName() << " Seeking subscription to " << timestamp);
+    } else {
+        LOG_INFO(getName() << " Seeking subscription to " << seekId);
+    }
+
+    std::weak_ptr<ConsumerImpl> weakSelf{shared_from_this()};
+
+    cnx->sendRequestWithId(seek, requestId)
+        .addListener([this, weakSelf, callback, originalSeekMessageId](Result 
result,
+                                                                       const 
ResponseData& responseData) {

Review Comment:
   Yes, but we never use the `weakSelf` in the lambda.



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