Class WaitAsyncExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<GreetingRequest,String>
software.amazon.lambda.durable.examples.WaitAsyncExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
Example demonstrating non-blocking wait with waitAsync().
This handler starts a wait and a step concurrently, then collects both results. The wait acts as a minimum duration guarantee — the step runs in parallel, and the handler only proceeds once both the step completes and the wait elapses.
- Start a 5-second async wait (non-blocking)
- Start an async step concurrently
- Collect both results — ensures at least 5 seconds have passed
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(GreetingRequest input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, createObjectMapper, getConfiguration, handleRequest
-
Constructor Details
-
WaitAsyncExample
public WaitAsyncExample()
-
-
Method Details
-
handleRequest
Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<GreetingRequest,String> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-