Class ProgressingFutures

  • public class ProgressingFutures
    extends Object
    Utilities around ProgressingFuture, added as static methods so as not to overload the interfaces with default methods.
    • Constructor Detail

      • ProgressingFutures

        public ProgressingFutures()
    • Method Detail

      • immediate

        public static <T> ProgressingFuture<T> immediate​(T value)
        A future whose result is already computed.
      • exception

        public static <T> ProgressingFuture<T> exception​(Exception e)
        A precomputed future in an error state, defined by the supplied exception.
      • fromListenableFuture

        public static <T> ProgressingFuture<T> fromListenableFuture​(<T> future,
                                                                    Executor executor)
        Wraps a listenable future into a progressing future which does not support reporting progress or pausing.
      • transform

        public static <T,​U> ProgressingFuture<U> transform​(ProgressingFuture<T> future,
                                                       <T,​U> function,
        Chaining a future with a transformation.
        future - the future containing the first computation in the chain
        function - the second computation to apply on top of the result of the future. This function must be relatively quick as no progress reporting or pausing for it will be supported by the returned future
        executor - the executor to use to schedule the execution of the second computation
        a future which combines the two computations