Class ChildContextOperation<T>
java.lang.Object
software.amazon.lambda.durable.operation.BaseDurableOperation
software.amazon.lambda.durable.operation.SerializableDurableOperation<T>
software.amazon.lambda.durable.operation.ChildContextOperation<T>
- All Implemented Interfaces:
DurableFuture<T>
Manages the lifecycle of a child execution context.
A child context runs a user function in a separate thread with its own operation counter and checkpoint log. Operations within the child context use the child's context ID as their parentId.
When created as part of a ConcurrencyOperation (e.g., parallel execution), the child notifies its parent
on completion via onItemComplete() BEFORE closing its own child context. It also skips checkpointing if the
parent operation has already succeeded.
-
Field Summary
Fields inherited from class software.amazon.lambda.durable.operation.BaseDurableOperation
completionFuture, executionManager, parentOperation -
Constructor Summary
ConstructorsConstructorDescriptionChildContextOperation(OperationIdentifier operationIdentifier, Function<DurableContext, T> function, TypeToken<T> resultTypeToken, RunInChildContextConfig config, DurableContextImpl durableContext) ChildContextOperation(OperationIdentifier operationIdentifier, Function<DurableContext, T> function, TypeToken<T> resultTypeToken, RunInChildContextConfig config, DurableContextImpl durableContext, ConcurrencyOperation<?> parentOperation) -
Method Summary
Methods inherited from class software.amazon.lambda.durable.operation.SerializableDurableOperation
deserializeException, deserializeResult, serializeException, serializeResultMethods inherited from class software.amazon.lambda.durable.operation.BaseDurableOperation
execute, getChildOperations, getCompletionFuture, getContext, getCurrentThreadContext, getName, getOperation, getOperationId, getSubType, getType, isOperationCompleted, markAlreadyCompleted, onCheckpointComplete, pollForOperationUpdates, pollForOperationUpdates, registerActiveThread, runUserHandler, sendOperationUpdate, sendOperationUpdateAsync, terminateExecution, terminateExecutionWithIllegalDurableOperationException, validateReplay, waitForOperationCompletion
-
Constructor Details
-
ChildContextOperation
public ChildContextOperation(OperationIdentifier operationIdentifier, Function<DurableContext, T> function, TypeToken<T> resultTypeToken, RunInChildContextConfig config, DurableContextImpl durableContext) -
ChildContextOperation
public ChildContextOperation(OperationIdentifier operationIdentifier, Function<DurableContext, T> function, TypeToken<T> resultTypeToken, RunInChildContextConfig config, DurableContextImpl durableContext, ConcurrencyOperation<?> parentOperation)
-
-
Method Details
-
start
protected void start()Starts the operation.- Specified by:
startin classBaseDurableOperation
-
replay
protected void replay(software.amazon.awssdk.services.lambda.model.Operation existing) Replays the operation.- Specified by:
replayin classBaseDurableOperation- Parameters:
existing- the checkpointed operation state
-
get
Description copied from interface:DurableFutureBlocks until the operation completes and returns the result.This delegates to operation.get() which handles: - Thread deregistration (allows suspension) - Thread reactivation (resumes execution) - Result retrieval
- Specified by:
getin interfaceDurableFuture<T>- Specified by:
getin classSerializableDurableOperation<T>- Returns:
- the operation result
-