You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/05/18 03:37:51 UTC

[GitHub] [pulsar-client-node] hrsakai commented on a change in pull request #153: Support Reader Listener

hrsakai commented on a change in pull request #153:
URL: https://github.com/apache/pulsar-client-node/pull/153#discussion_r634015393



##########
File path: src/Reader.cc
##########
@@ -66,33 +105,41 @@ class ReaderNewInstanceWorker : public Napi::AsyncWorker {
 
     pulsar_result result =
         pulsar_client_create_reader(this->cClient, topic.c_str(), this->readerConfig->GetCStartMessageId(),
-                                    this->readerConfig->GetCReaderConfig(), &(this->cReader));
-    delete this->readerConfig;
+                                    this->readerConfig->GetCReaderConfig(), &this->readerWrapper->cReader);
     if (result != pulsar_result_Ok) {
       SetError(std::string("Failed to create reader: ") + pulsar_result_str(result));
       return;
+    } else {
+      this->listener = this->readerConfig->GetListenerCallback();
     }
+    delete this->readerConfig;

Review comment:
       if `result` is not ok, won't this line be executed?




-- 
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:
users@infra.apache.org