merlimat commented on code in PR #54:
URL: https://github.com/apache/pulsar-client-cpp/pull/54#discussion_r1000165014


##########
lib/ConsumerImpl.cc:
##########
@@ -37,15 +37,14 @@ namespace pulsar {
 
 DECLARE_LOG_OBJECT()
 
-ConsumerImpl::ConsumerImpl(const ClientImplPtr client, const std::string& 
topic,
-                           const std::string& subscriptionName, const 
ConsumerConfiguration& conf,
-                           bool isPersistent,
+ConsumerImpl::ConsumerImpl(ClientImpl& client, const std::string& topic, const 
std::string& subscriptionName,

Review Comment:
   Why do we need to change from storing a `weak_ptr` to a reference?
   
   The problem with this is that if you keep using a producer/consumer after 
the client is already destroyed, you would have a segfault. With the `weak_ptr` 
we are force to always validating it before using it.



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