Class AsyncExecution<O>
java.lang.Object
software.amazon.lambda.durable.testing.AsyncExecution<O>
Handle for an asynchronously executing durable function. Allows incremental polling and inspection of execution
state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCallbackId(String operationName) Get the callback ID for a callback operation.Get the execution ARN.getOperation(String name) Get details for a specific operation.Get all operations in the execution.Get current execution status.booleanhasCallback(String name) Check if a callback operation with the given name exists and is started.booleanhasOperation(String name) Check if an operation with the given name exists.booleanCheck if execution has completed (succeeded or failed).pollUntil(Predicate<AsyncExecution<O>> condition) Poll execution history until the given condition is met.Poll until execution completes and return the final result.
-
Constructor Details
-
AsyncExecution
-
-
Method Details
-
pollUntil
Poll execution history until the given condition is met.- Parameters:
condition- predicate to test on each poll- Returns:
- this execution for chaining
-
pollUntilComplete
Poll until execution completes and return the final result.- Returns:
- test result with execution status and output
-
isComplete
public boolean isComplete()Check if execution has completed (succeeded or failed). -
hasOperation
Check if an operation with the given name exists. -
hasCallback
Check if a callback operation with the given name exists and is started. -
getCallbackId
Get the callback ID for a callback operation.- Parameters:
operationName- name of the callback operation- Returns:
- callback ID
- Throws:
IllegalStateException- if no callback found for operation
-
getOperation
Get details for a specific operation. -
getOperations
Get all operations in the execution. -
getStatus
Get current execution status. -
getExecutionArn
Get the execution ARN.
-