Class ParallelExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<ParallelExample.Input,ParallelExample.Output>
software.amazon.lambda.durable.examples.parallel.ParallelExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
Example demonstrating parallel branch execution with the Durable Execution SDK.
This handler processes a list of items concurrently using context.parallel():
- Each item is processed in its own branch (child context)
- All branches run concurrently and their results are collected
- A final step combines the results into a summary
The ParallelDurableFuture implements AutoCloseable, so try-with-resources guarantees
join() is called even if an exception occurs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(ParallelExample.Input input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, getConfiguration, handleRequest
-
Constructor Details
-
ParallelExample
public ParallelExample()
-
-
Method Details
-
handleRequest
Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<ParallelExample.Input,ParallelExample.Output> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-