Class ParallelFailureToleranceExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<ParallelFailureToleranceExample.Input,ParallelFailureToleranceExample.Output>
software.amazon.lambda.durable.examples.parallel.ParallelFailureToleranceExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
public class ParallelFailureToleranceExample
extends DurableHandler<ParallelFailureToleranceExample.Input,ParallelFailureToleranceExample.Output>
Example demonstrating parallel execution with failure tolerance.
When toleratedFailureCount is set, the parallel operation completes successfully even if some branches
fail — as long as the number of failures does not exceed the threshold. Failed branches produce null results
that callers can filter out.
Use this pattern when partial success is acceptable, for example: sending notifications to multiple channels where some channels may be unavailable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(ParallelFailureToleranceExample.Input input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, getConfiguration, handleRequest
-
Constructor Details
-
ParallelFailureToleranceExample
public ParallelFailureToleranceExample()
-
-
Method Details
-
handleRequest
public ParallelFailureToleranceExample.Output handleRequest(ParallelFailureToleranceExample.Input input, DurableContext context) Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<ParallelFailureToleranceExample.Input,ParallelFailureToleranceExample.Output> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-