You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/02/09 15:55:50 UTC

[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #14185: Java client: only schedule batch when there are pending messages

michaeljmarshall commented on a change in pull request #14185:
URL: https://github.com/apache/pulsar/pull/14185#discussion_r802817355



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
##########
@@ -1947,8 +1933,34 @@ protected void triggerFlush() {
         }
     }
 
+    // must acquire semaphore before calling
+    private void maybeTriggerBatchTimerTask() {
+        if (this.batchTimerTask == null) {
+            this.batchTimerTask = cnx().ctx().executor()
+                    .schedule(catchingAndLoggingThrowables(() -> {

Review comment:
       I agree.




-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org