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 TypeMethodDescriptionvoidcompleteCallback(String callbackId, String result) calls sendDurableExecutionCallbackSuccess with the given callbackId and resultvoidfailCallback(String callbackId, software.amazon.awssdk.services.lambda.model.ErrorObject error) calls sendDurableExecutionCallbackFailure with the give callbackId and errorgetCallbackId(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.voidheartbeatCallback(String callbackId) call sendDurableExecutionCallbackHeartbeat API with the give callbackIdbooleanCheck 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. -
completeCallback
calls sendDurableExecutionCallbackSuccess with the given callbackId and result -
failCallback
public void failCallback(String callbackId, software.amazon.awssdk.services.lambda.model.ErrorObject error) calls sendDurableExecutionCallbackFailure with the give callbackId and error -
heartbeatCallback
call sendDurableExecutionCallbackHeartbeat API with the give callbackId
-