Class ChildContextExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<GreetingRequest,String>
software.amazon.lambda.durable.examples.ChildContextExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
Example demonstrating child context workflows with the Durable Execution SDK.
This handler runs three concurrent child contexts using runInChildContextAsync:
- Order validation — performs a step then suspends via
wait()before completing - Inventory check — performs a step then suspends via
wait()before completing - Shipping estimate — nests another child context inside it to demonstrate hierarchical contexts
All three child contexts run concurrently. Results are collected with DurableFuture.allOf(software.amazon.lambda.durable.DurableFuture<T>...) and combined
into a summary string.
-
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
-
ChildContextExample
public ChildContextExample()
-
-
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
-