Skip to content

Commit 5c4ac7a

Browse files
committed
Minor javadoc improvements
1 parent 36fae1d commit 5c4ac7a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/net/jodah/failsafe/FailsafeExecutor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
* Failsafe#with(Policy[])}.
3535
* <p>
3636
* Async executions are run by default on the {@link ForkJoinPool#commonPool()}. Alternative executors can be configured
37-
* via {@link #with(ScheduledExecutorService)} and similar methods. All async executions are cancellable via the
38-
* returned CompletableFuture, even those run by a {@link ForkJoinPool} or {@link CompletionStage}.
37+
* via {@link #with(ScheduledExecutorService)} and similar methods. All async executions are cancellable and
38+
* interruptable via the returned CompletableFuture, even those run by a {@link ForkJoinPool} or {@link CompletionStage}.
3939
*
4040
* @param <R> result type
4141
* @author Jonathan Halterman

src/test/java/net/jodah/failsafe/Testing.java

+6
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,18 @@ public static <T extends CircuitState> T stateFor(CircuitBreaker breaker) {
8585
}
8686
}
8787

88+
/**
89+
* Returns a future that is completed with the {@code result} on the {@code executor}.
90+
*/
8891
public static CompletableFuture<Object> futureResult(ScheduledExecutorService executor, Object result) {
8992
CompletableFuture<Object> future = new CompletableFuture<>();
9093
executor.schedule(() -> future.complete(result), 0, TimeUnit.MILLISECONDS);
9194
return future;
9295
}
9396

97+
/**
98+
* Returns a future that is completed with the {@code exception} on the {@code executor}.
99+
*/
94100
public static CompletableFuture<Object> futureException(ScheduledExecutorService executor, Exception exception) {
95101
CompletableFuture<Object> future = new CompletableFuture<>();
96102
executor.schedule(() -> future.completeExceptionally(exception), 0, TimeUnit.MILLISECONDS);

0 commit comments

Comments
 (0)