vjagadish1989 commented on a change in pull request #905: SAMZA-2055: [WIP] Async high level api URL: https://github.com/apache/samza/pull/905#discussion_r262762273
########## File path: samza-core/src/main/java/org/apache/samza/operators/impl/OperatorImpl.java ########## @@ -184,19 +185,41 @@ public final void onMessage(M message, MessageCollector collector, TaskCoordinat getOpImplId(), getOperatorSpec().getSourceLocation(), expectedType, actualType), e); } - long endNs = this.highResClock.nanoTime(); - this.handleMessageNs.update(endNs - startNs); - - results.forEach(rm -> - this.registeredOperators.forEach(op -> - op.onMessage(rm, collector, coordinator))); + CompletionStage<Void> result = completableResultsFuture.thenCompose(results -> { + long endNs = this.highResClock.nanoTime(); + this.handleMessageNs.update(endNs - startNs); + + return CompletableFuture.allOf(results.stream() Review comment: Upto you; But, I'd personally prefer retaining the forEach flow for consistency with rest of the code-base ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services