Interface ParallelDurableFuture

All Superinterfaces:
AutoCloseable, DurableFuture<ParallelResult>
All Known Implementing Classes:
ParallelOperation

public interface ParallelDurableFuture extends AutoCloseable, DurableFuture<ParallelResult>
User-facing context for managing parallel branch execution within a durable function.
  • 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 name
      resultType - the result type token for generic types
      func - the function to execute in the branch's child context
      Returns:
      a DurableFuture that will contain the branch result
      Throws:
      IllegalStateException - if called after close()
    • 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 name
      resultType - the result type token for generic types
      func - the function to execute in the branch's child context
      Returns:
      a DurableFuture that will contain the branch result
      Throws:
      IllegalStateException - if called after close()
    • 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 name
      resultType - the result type token for generic types
      func - the function to execute in the branch's child context
      Returns:
      a DurableFuture that will contain the branch result
      Throws:
      IllegalStateException - if called after close()
    • 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 name
      resultType - the result type token for generic types
      func - the function to execute in the branch's child context
      Returns:
      a DurableFuture that will contain the branch result
      Throws:
      IllegalStateException - if called after close()
    • close

      void close()
      Calls DurableFuture.get() if not already called. Guarantees that the context is closed.
      Specified by:
      close in interface AutoCloseable