Package software.amazon.lambda.durable
Interface ParallelDurableFuture
- All Superinterfaces:
AutoCloseable,DurableFuture<ParallelResult>
- All Known Implementing Classes:
ParallelOperation
User-facing context for managing parallel branch execution within a durable function.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> DurableFuture<T>branch(String name, Class<T> resultType, Function<DurableContext, T> func) Registers and immediately starts a branch (respects maxConcurrency).default <T> DurableFuture<T>branch(String name, Class<T> resultType, Function<DurableContext, T> func, ParallelBranchConfig config) Registers and immediately starts a branch (respects maxConcurrency).default <T> DurableFuture<T>branch(String name, TypeToken<T> resultType, Function<DurableContext, T> func) Registers and immediately starts a branch (respects maxConcurrency).<T> DurableFuture<T>branch(String name, TypeToken<T> resultType, Function<DurableContext, T> func, ParallelBranchConfig config) Registers and immediately starts a branch (respects maxConcurrency).voidclose()CallsDurableFuture.get()if not already called.Methods inherited from interface software.amazon.lambda.durable.DurableFuture
get
-
Method Details
-
branch
default <T> DurableFuture<T> branch(String name, Class<T> resultType, Function<DurableContext, T> func) Registers and immediately starts a branch (respects maxConcurrency).- Type Parameters:
T- the result type- Parameters:
name- the branch nameresultType- the result type token for generic typesfunc- the function to execute in the branch's child context- Returns:
- a
DurableFuturethat will contain the branch result - Throws:
IllegalStateException- if called afterclose()
-
branch
default <T> DurableFuture<T> branch(String name, TypeToken<T> resultType, Function<DurableContext, T> func) Registers and immediately starts a branch (respects maxConcurrency).- Type Parameters:
T- the result type- Parameters:
name- the branch nameresultType- the result type token for generic typesfunc- the function to execute in the branch's child context- Returns:
- a
DurableFuturethat will contain the branch result - Throws:
IllegalStateException- if called afterclose()
-
branch
default <T> DurableFuture<T> branch(String name, Class<T> resultType, Function<DurableContext, T> func, ParallelBranchConfig config) Registers and immediately starts a branch (respects maxConcurrency).- Type Parameters:
T- the result type- Parameters:
name- the branch nameresultType- the result type token for generic typesfunc- the function to execute in the branch's child context- Returns:
- a
DurableFuturethat will contain the branch result - Throws:
IllegalStateException- if called afterclose()
-
branch
<T> DurableFuture<T> branch(String name, TypeToken<T> resultType, Function<DurableContext, T> func, ParallelBranchConfig config) Registers and immediately starts a branch (respects maxConcurrency).- Type Parameters:
T- the result type- Parameters:
name- the branch nameresultType- the result type token for generic typesfunc- the function to execute in the branch's child context- Returns:
- a
DurableFuturethat will contain the branch result - Throws:
IllegalStateException- if called afterclose()
-
close
void close()CallsDurableFuture.get()if not already called. Guarantees that the context is closed.- Specified by:
closein interfaceAutoCloseable
-