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.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.lambda.durable.operation.SerializableDurableOperation
SerializableDurableOperation.SerializedResult<T> -
Field Summary
Fields inherited from class software.amazon.lambda.durable.operation.BaseDurableOperation
completionFuture, executionManager, isVirtual, parentOperation, replayCompletedOperation -
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, serDesContext, serializeAndDeserializeResult, serializeExceptionMethods inherited from class software.amazon.lambda.durable.operation.BaseDurableOperation
deregisterActiveThread, execute, extractErrorFromOperation, fireOnOperationEnd, getChildOperations, getCompletionFuture, getContext, getCurrentThreadContext, getErrorObject, getName, getOperation, getOperationId, getRunningUserHandler, getSubType, getType, interruptRunningUserHandler, isOperationCompleted, isRunningUserHandlerOwner, markAlreadyCompleted, onCheckpointComplete, pollForOperationUpdates, pollForOperationUpdates, processCheckpointUpdate, registerActiveThread, runUserFunction, runUserHandler, sendOperationUpdate, sendOperationUpdateAsync, terminateExecution, terminateExecutionWithIllegalDurableOperationException, validateReplay, waitForFirstOperationCompletion, 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
-