v1.2.0
Added
Retry.executeAsync(Supplier<CompletableFuture<T>>): an async counterpart to the existingexecute(Callable<T>), for tasks that already return aCompletableFuture<T>.- Applies the exact same retry policy as the synchronous path — reuses the existing exception-type matching (
retryOn) and delay computation (backoff multiplier + jitter) logic rather than duplicating it. - Never blocks a thread while waiting between attempts: retries are scheduled via
CompletableFuture.delayedExecutor(...)instead ofThread.sleep. - Treats a synchronous throw from the supplier itself the same as an exceptionally-completed future, and unwraps
CompletionExceptionbefore the retryability check soretryOn-configured types match as they would on the sync path. - Returns a
CompletableFuture<T>that completes with the eventual result, or completes exceptionally once retries are exhausted or the failure isn't retryable.
- Applies the exact same retry policy as the synchronous path — reuses the existing exception-type matching (
- New README "Async Retry" section with a runnable example, plus an additional realistic example (a reused policy across multiple calls) in "Usage".
- New
RetryTestcoverage for the async path: eventual success after N failures with exact invocation-count assertions, immediate failure on a non-retryable exception, exhaustion aftermaxAttempts, first-try success, and a supplier that throws synchronously before returning a future — all using short (single-digit ms) configured backoff, no real multi-second waits.
Zero dependencies, pure Java 17, no build tool required — unchanged from prior releases.