From commits-return-10704-archive-asf-public=cust-asf.ponee.io@pulsar.incubator.apache.org Mon Jul 9 12:50:40 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 64D5F18077A for ; Mon, 9 Jul 2018 12:50:39 +0200 (CEST) Received: (qmail 13369 invoked by uid 500); 9 Jul 2018 10:50:38 -0000 Mailing-List: contact commits-help@pulsar.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.incubator.apache.org Delivered-To: mailing list commits@pulsar.incubator.apache.org Received: (qmail 13331 invoked by uid 99); 9 Jul 2018 10:50:38 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jul 2018 10:50:38 +0000 From: GitBox To: commits@pulsar.apache.org Subject: [GitHub] ivankelly commented on a change in pull request #2103: Issue 1433: Expose batch flushAsync() and flush() methods in Producer Message-ID: <153113343791.17812.5527330239012313891.gitbox@gitbox.apache.org> Date: Mon, 09 Jul 2018 10:50:37 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit ivankelly commented on a change in pull request #2103: Issue 1433: Expose batch flushAsync() and flush() methods in Producer URL: https://github.com/apache/incubator-pulsar/pull/2103#discussion_r200953979 ########## File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java ########## @@ -333,6 +335,7 @@ public void sendAsync(Message message, SendCallback callback) { // batch size and/or max message size if (batchMessageContainer.hasSpaceInBatch(msg)) { batchMessageContainer.add(msg, callback); + lastSendFuture = callback.getFuture(); Review comment: Can't we just assign lastSendFuture once, before calling isBatchMessagingEnabled()? Once we get to that point, the message is going to best sent in any case. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 With regards, Apache Git Services