dajac commented on code in PR #15462:
URL: https://github.com/apache/kafka/pull/15462#discussion_r1516215271


##########
server-common/src/main/java/org/apache/kafka/server/util/FutureUtils.java:
##########
@@ -125,4 +127,21 @@ public static <T> CompletableFuture<T> combineFutures(
             return res;
         });
     }
+
+    /**
+     * Applies the given exception handler to all the futures provided in the 
list
+     * and returns a new list of futures.
+     *
+     * @param futures   A list of futures.
+     * @param fn        A function taking an exception to handle it.
+     * @return A list of futures.
+     */
+    public static <T> List<CompletableFuture<T>> mapExceptionally(

Review Comment:
   Interesting idea. I would prefer to keep `combineFutures` simple. 
`mapExceptionally` and `combineFutures` are two different things in my opinion. 
I also envision that we could have a need for something different that 
`exceptionally` in the future. If we go on that path, it means that we would 
need to overload `combineFutures` to support different ones and it will get 
messy.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to