Skip to content

Commit 1d01f1e

Browse files
committed
rename execute method
1 parent 66c7047 commit 1d01f1e

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

sdk/src/main/java/com/amazonaws/lambda/durable/DurableExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public static <I, O> DurableExecutionOutput execute(
8181
// Execute the handlerFuture in ExecutionManager. If it completes successfully, the output of user function
8282
// will be returned. Otherwise, it will complete exceptionally with a SuspendExecutionException or a failure.
8383
return executionManager
84-
.execute(handlerFuture)
84+
.runUntilCompleteOrSuspend(handlerFuture)
8585
.handle((result, ex) -> {
8686
if (ex != null) {
8787
// an exception thrown from handlerFuture or suspension/termination occurred

sdk/src/main/java/com/amazonaws/lambda/durable/execution/ExecutionManager.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,15 @@ public void suspendExecution() {
320320
}
321321

322322
/**
323-
* execute the customer provided future and completes when one of userFuture, suspendExecutionFuture and
324-
* terminateExecutionFuture completes.
323+
* return a future that completes when userFuture completes successfully or the execution is terminated or
324+
* suspended.
325325
*
326326
* @param userFuture user provided function
327-
* @return a future of userFuture result if userFuture completes successfully earlier than suspendExecutionFuture
328-
* and terminateExecutionFuture.
327+
* @return a future of userFuture result if userFuture completes successfully, a user exception if userFuture
328+
* completes with an exception, a SuspendExecutionException if the execution is suspended, or an
329+
* UnrecoverableDurableExecutionException if the execution is terminated.
329330
*/
330-
public <T> CompletableFuture<T> execute(CompletableFuture<T> userFuture) {
331+
public <T> CompletableFuture<T> runUntilCompleteOrSuspend(CompletableFuture<T> userFuture) {
331332
return CompletableFuture.anyOf(userFuture, executionExceptionFuture).thenApply(v -> {
332333
// reaches here only if userFuture complete successfully
333334
if (userFuture.isDone()) {

0 commit comments

Comments
 (0)