Lalant commented on code in PR #7379:
URL: https://github.com/apache/ignite-3/pull/7379#discussion_r2697772918
##########
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java:
##########
@@ -1232,6 +1232,51 @@ public static <T> void retryOperationUntilSuccess(
});
}
+ /**
+ * Retries operation until it succeeds or timeout occurs.
+ *
+ * @param operation Operation.
+ * @param timeout Timeout in milliseconds.
+ * @param executor Executor to make retry in.
+ * @return Future that is completed when operation is successful or failed
with other exception than the given.
+ */
+ public static <T> CompletableFuture<T> retryOperationUntilSuccessOrTimeout(
+ Supplier<CompletableFuture<T>> operation,
+ long timeout,
Review Comment:
Considering that we already use this method in just one place, I don’t see a
strong reason to introduce an additional optional argument. Also, having both
stopRetryCondition and timeout feels redundant, since they effectively serve
the same purpose, with timeout being the stricter.
--
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]