Class StateFutureUtils


  • @Experimental
    public class StateFutureUtils
    extends Object
    A collection of utilities that expand the usage of StateFuture. All the methods can only be accessed within user function provided to KeyedStream.
    • Constructor Detail

      • StateFutureUtils

        public StateFutureUtils()
    • Method Detail

      • completedVoidFuture

        public static <V> StateFuture<V> completedVoidFuture()
        Returns a completed future that does nothing and return null.
      • completedFuture

        public static <V> StateFuture<V> completedFuture​(V result)
        Returns a completed future that does nothing and return provided result.
      • combineAll

        public static <T> StateFuture<Collection<T>> combineAll​(Collection<? extends StateFuture<? extends T>> futures)
        Creates a future that is complete once multiple other futures completed. Upon successful completion, the future returns the collection of the futures' results.
        Parameters:
        futures - The futures that make up the conjunction. No null entries are allowed, otherwise a IllegalArgumentException will be thrown.
        Returns:
        The StateFuture that completes once all given futures are complete.