BewareMyPower commented on code in PR #71:
URL: https://github.com/apache/pulsar-client-cpp/pull/71#discussion_r1013613834
##########
lib/ConsumerImpl.cc:
##########
@@ -331,6 +371,13 @@ Optional<SharedBuffer>
ConsumerImpl::processMessageChunk(const SharedBuffer& pay
<< payload.readableBytes() <<
" bytes");
Lock lock(chunkProcessMutex_);
+
+ // Lazy task scheduling to expire incomplete chunk message
+ if (!checkExpiredChunkedTimer_) {
+ checkExpiredChunkedTimer_ = executor_->createDeadlineTimer();
+ triggerCheckExpiredChunkedTimer();
+ }
Review Comment:
We should add a boolean variable `expireChunkMessageTaskScheduled` like Java
client does. You can also use something like `Optional` but since
`deadline_timer` is not copyable you have to use the move constructor.
BTW, I am going to remove unnecessary `std::shared_ptr` usages in C++
client. It should not be used everywhere. When writing C++, the best practice
is to make the lifetime clear like writing Rust.
--
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]