Skip to content

Commit

Permalink
Rename Failsafe.futureAsync -> futureAsyncExecution (for now) for con…
Browse files Browse the repository at this point in the history
…sistenty
  • Loading branch information
jhalterman committed Jan 3, 2019
1 parent 101140d commit c79f4e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/net/jodah/failsafe/FailsafeExecutor.java
Expand Up @@ -151,7 +151,7 @@ public <T> CompletableFuture<T> future(ContextualCallable<? extends CompletionSt
* @throws NullPointerException if the {@code callable} is null
* @throws RejectedExecutionException if the {@code callable} cannot be scheduled for execution
*/
public <T> CompletableFuture<T> futureAsync(AsyncCallable<? extends CompletionStage<T>> callable) {
public <T> CompletableFuture<T> futureAsyncExecution(AsyncCallable<? extends CompletionStage<T>> callable) {
return callAsync(execution -> Functions.asyncOfFuture(callable, execution));
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/net/jodah/failsafe/AsyncFailsafeTest.java
Expand Up @@ -268,7 +268,7 @@ public void shouldHandleThrowingFutureCallable() {
throw new IllegalArgumentException();
}).get(), ExecutionException.class, IllegalArgumentException.class);

assertThrows(() -> Failsafe.with(retryTwice).with(executor).futureAsync(exec -> {
assertThrows(() -> Failsafe.with(retryTwice).with(executor).futureAsyncExecution(exec -> {
throw new IllegalArgumentException();
}).get(), ExecutionException.class, IllegalArgumentException.class);
}
Expand Down Expand Up @@ -396,6 +396,6 @@ private <T> CompletableFuture<T> future(FailsafeExecutor<?> failsafe, Object cal
else if (callable instanceof ContextualCallable)
return failsafe.future((ContextualCallable<CompletableFuture<T>>) callable);
else
return failsafe.futureAsync((AsyncCallable<CompletableFuture<T>>) callable);
return failsafe.futureAsyncExecution((AsyncCallable<CompletableFuture<T>>) callable);
}
}

0 comments on commit c79f4e1

Please sign in to comment.