Class ParallelWithWaitExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<ParallelWithWaitExample.Input,ParallelWithWaitExample.Output>
software.amazon.lambda.durable.examples.parallel.ParallelWithWaitExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
public class ParallelWithWaitExample
extends DurableHandler<ParallelWithWaitExample.Input,ParallelWithWaitExample.Output>
Example demonstrating parallel branches where some branches include wait operations.
This models a notification fan-out pattern where different channels have different delivery delays:
- Email — sent immediately
- SMS — waits for a rate-limit window before sending
- Push notification — waits for a quiet-hours window before sending
All three branches run concurrently. Branches with waits suspend without consuming compute resources and resume automatically once the wait elapses. The parallel operation completes once all branches finish.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(ParallelWithWaitExample.Input input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, getConfiguration, handleRequest
-
Constructor Details
-
ParallelWithWaitExample
public ParallelWithWaitExample()
-
-
Method Details
-
handleRequest
public ParallelWithWaitExample.Output handleRequest(ParallelWithWaitExample.Input input, DurableContext context) Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<ParallelWithWaitExample.Input,ParallelWithWaitExample.Output> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-