Package software.amazon.lambda.durable
Class DurableContext
java.lang.Object
software.amazon.lambda.durable.DurableContext
-
Method Summary
Modifier and TypeMethodDescription<T> DurableCallbackFuture<T> createCallback(String name, Class<T> resultType) <T> DurableCallbackFuture<T> createCallback(String name, Class<T> resultType, CallbackConfig config) <T> DurableCallbackFuture<T> createCallback(String name, TypeToken<T> typeToken) <T> DurableCallbackFuture<T> createCallback(String name, TypeToken<T> typeToken, CallbackConfig config) static DurableContextcreateChildContext(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String contextId) Creates a child context without registering the current thread.Returns metadata about the current durable execution.com.amazonaws.services.lambda.runtime.Context<T,U> T <T,U> T invoke(String name, String functionName, U payload, Class<T> resultType, InvokeConfig config) <T,U> T <T,U> T invoke(String name, String functionName, U payload, TypeToken<T> typeToken, InvokeConfig config) <T,U> DurableFuture <T> invokeAsync(String name, String functionName, U payload, Class<T> resultType) <T,U> DurableFuture <T> invokeAsync(String name, String functionName, U payload, Class<T> resultType, InvokeConfig config) <T,U> DurableFuture <T> invokeAsync(String name, String functionName, U payload, TypeToken<T> resultType) <T,U> DurableFuture <T> invokeAsync(String name, String functionName, U payload, TypeToken<T> typeToken, InvokeConfig config) <T> TrunInChildContext(String name, Class<T> resultType, Function<DurableContext, T> func) <T> TrunInChildContext(String name, TypeToken<T> typeToken, Function<DurableContext, T> func) <T> DurableFuture<T> runInChildContextAsync(String name, Class<T> resultType, Function<DurableContext, T> func) <T> DurableFuture<T> runInChildContextAsync(String name, TypeToken<T> typeToken, Function<DurableContext, T> func) <T> T<T> Tstep(String name, Class<T> resultType, Supplier<T> func, StepConfig config) <T> T<T> Tstep(String name, TypeToken<T> typeToken, Supplier<T> func, StepConfig config) <T> DurableFuture<T> <T> DurableFuture<T> stepAsync(String name, Class<T> resultType, Supplier<T> func, StepConfig config) <T> DurableFuture<T> <T> DurableFuture<T> stepAsync(String name, TypeToken<T> typeToken, Supplier<T> func, StepConfig config)
-
Method Details
-
createChildContext
public static DurableContext createChildContext(ExecutionManager executionManager, DurableConfig durableConfig, com.amazonaws.services.lambda.runtime.Context lambdaContext, String contextId) Creates a child context without registering the current thread. Thread registration is handled by ChildContextOperation, which registers on the parent thread before the executor runs and sets the context on the child thread inside the executor.- Parameters:
executionManager- the execution managerdurableConfig- the durable configurationlambdaContext- the Lambda contextcontextId- the child context's ID (the CONTEXT operation's operation ID)- Returns:
- a new DurableContext for the child context
-
step
-
step
-
step
-
step
-
stepAsync
-
stepAsync
public <T> DurableFuture<T> stepAsync(String name, Class<T> resultType, Supplier<T> func, StepConfig config) -
stepAsync
-
stepAsync
public <T> DurableFuture<T> stepAsync(String name, TypeToken<T> typeToken, Supplier<T> func, StepConfig config) -
wait
-
wait
-
invoke
-
invoke
public <T,U> T invoke(String name, String functionName, U payload, Class<T> resultType, InvokeConfig config) -
invoke
-
invoke
public <T,U> T invoke(String name, String functionName, U payload, TypeToken<T> typeToken, InvokeConfig config) -
invokeAsync
public <T,U> DurableFuture<T> invokeAsync(String name, String functionName, U payload, Class<T> resultType, InvokeConfig config) -
invokeAsync
public <T,U> DurableFuture<T> invokeAsync(String name, String functionName, U payload, Class<T> resultType) -
invokeAsync
public <T,U> DurableFuture<T> invokeAsync(String name, String functionName, U payload, TypeToken<T> resultType) -
invokeAsync
public <T,U> DurableFuture<T> invokeAsync(String name, String functionName, U payload, TypeToken<T> typeToken, InvokeConfig config) -
createCallback
public <T> DurableCallbackFuture<T> createCallback(String name, Class<T> resultType, CallbackConfig config) -
createCallback
-
createCallback
-
createCallback
public <T> DurableCallbackFuture<T> createCallback(String name, TypeToken<T> typeToken, CallbackConfig config) -
runInChildContext
-
runInChildContext
public <T> T runInChildContext(String name, TypeToken<T> typeToken, Function<DurableContext, T> func) -
runInChildContextAsync
public <T> DurableFuture<T> runInChildContextAsync(String name, Class<T> resultType, Function<DurableContext, T> func) -
runInChildContextAsync
public <T> DurableFuture<T> runInChildContextAsync(String name, TypeToken<T> typeToken, Function<DurableContext, T> func) -
getLambdaContext
public com.amazonaws.services.lambda.runtime.Context getLambdaContext() -
getLogger
-
getExecutionContext
Returns metadata about the current durable execution.The execution context provides information that remains constant throughout the execution lifecycle, such as the durable execution ARN. This is useful for tracking execution progress, correlating logs, and referencing this execution in external systems.
- Returns:
- the execution context
-