Class CallbackOperation<T>
java.lang.Object
software.amazon.lambda.durable.operation.BaseDurableOperation
software.amazon.lambda.durable.operation.SerializableDurableOperation<T>
software.amazon.lambda.durable.operation.CallbackOperation<T>
- All Implemented Interfaces:
DurableCallbackFuture<T>,DurableFuture<T>
public class CallbackOperation<T>
extends SerializableDurableOperation<T>
implements DurableCallbackFuture<T>
Durable operation for creating and waiting on external callbacks.
-
Field Summary
Fields inherited from class software.amazon.lambda.durable.operation.BaseDurableOperation
completionFuture, executionManager, parentOperation -
Constructor Summary
ConstructorsConstructorDescriptionCallbackOperation(OperationIdentifier operationIdentifier, TypeToken<T> resultTypeToken, CallbackConfig config, DurableContextImpl durableContext) -
Method Summary
Modifier and TypeMethodDescriptionReturns the unique identifier for this callback.get()Blocks until the operation completes and returns the result.protected voidreplay(software.amazon.awssdk.services.lambda.model.Operation existing) Replays the operation.protected voidstart()Starts the operation.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
-
CallbackOperation
public CallbackOperation(OperationIdentifier operationIdentifier, TypeToken<T> resultTypeToken, CallbackConfig config, DurableContextImpl durableContext)
-
-
Method Details
-
callbackId
Description copied from interface:DurableCallbackFutureReturns the unique identifier for this callback.External systems use this ID to send callback results back to the durable execution.
- Specified by:
callbackIdin interfaceDurableCallbackFuture<T>- Returns:
- the callback ID
-
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
-