Uses of Interface
io.activej.promise.Promise
-
Packages that use Promise Package Description io.activej.async io.activej.async.file io.activej.async.function io.activej.async.process io.activej.async.service io.activej.promise io.activej.promise.jmx -
-
Uses of Promise in io.activej.async
Methods in io.activej.async that return Promise Modifier and Type Method Description <V,T>
Promise<T>AsyncBuffer. add(BiConsumer<A,V> argumentAccumulator, Function<R,T> resultExtractor, V argument)<V> Promise<R>AsyncBuffer. add(BiConsumer<A,V> argumentAccumulator, V argument)Promise<Void>AsyncBuffer. flush()@NotNull Promise<A>AsyncAccumulator. get()Promise<R>AsyncBuffer. getBufferedPromise()Promise<A>AsyncAccumulator. run()Promise<A>AsyncAccumulator. run(@NotNull Promise<Void> runtimePromise)Methods in io.activej.async with parameters of type Promise Modifier and Type Method Description <T> voidAsyncAccumulator. addPromise(@NotNull Promise<T> promise, @NotNull BiConsumer<A,T> consumer)Promise<A>AsyncAccumulator. run(@NotNull Promise<Void> runtimePromise)<T> AsyncAccumulator<A>AsyncAccumulator. withPromise(@NotNull Promise<T> promise, @NotNull BiConsumer<A,T> accumulator)Constructor parameters in io.activej.async with type arguments of type Promise Constructor Description AsyncBuffer(Function<A,Promise<R>> executor, Supplier<A> bufferSupplier) -
Uses of Promise in io.activej.async.file
Methods in io.activej.async.file that return Promise Modifier and Type Method Description Promise<Integer>AsyncFileService. read(FileChannel channel, long position, byte[] array, int offset, int size)Promise<Integer>ExecutorAsyncFileService. read(FileChannel channel, long position, byte[] array, int offset, int size)Promise<Integer>AsyncFileService. write(FileChannel channel, long position, byte[] array, int offset, int size)Promise<Integer>ExecutorAsyncFileService. write(FileChannel channel, long position, byte[] array, int offset, int size) -
Uses of Promise in io.activej.async.function
Methods in io.activej.async.function that return Promise Modifier and Type Method Description @NotNull Promise<Void>AsyncConsumer. accept(T value)Consumes some data asynchronously.Promise<T>AsyncSupplier. get()GetsPromiseof data item asynchronously.Promise<Boolean>AsyncPredicate. test(T t)Promise<Boolean>AsyncPredicates.AsyncPredicateWrapper. test(T t)Methods in io.activej.async.function with parameters of type Promise Modifier and Type Method Description static <T> AsyncSupplier<T>AsyncSupplier. ofPromise(@NotNull Promise<T> promise)Method parameters in io.activej.async.function with type arguments of type Promise Modifier and Type Method Description default <V> @NotNull AsyncConsumer<V>AsyncConsumer. mapAsync(@NotNull Function<? super V,? extends Promise<T>> fn)default <V> @NotNull AsyncSupplier<V>AsyncSupplier. mapAsync(@NotNull Function<? super T,? extends Promise<V>> fn)Applies function to the result of suppliedPromise.static <T> AsyncSupplier<T>AsyncSupplier. of(@NotNull Supplier<Promise<T>> supplier)static <T> AsyncSupplier<T>AsyncSupplier. ofPromiseIterable(@NotNull Iterable<? extends Promise<T>> iterable)static <T> AsyncSupplier<T>AsyncSupplier. ofPromiseIterator(@NotNull Iterator<? extends Promise<T>> iterator)static <T> AsyncSupplier<T>AsyncSupplier. ofPromiseStream(@NotNull Stream<? extends Promise<T>> stream) -
Uses of Promise in io.activej.async.process
Methods in io.activej.async.process that return Promise Modifier and Type Method Description default <T> @NotNull Promise<T>AsyncExecutor. call(@NotNull Callable<T> callable)<T> @NotNull Promise<T>AsyncExecutor. execute(@NotNull AsyncSupplier<T> supplier)@NotNull Promise<Void>AsyncProcess. getProcessCompletion()default @NotNull Promise<Void>AsyncExecutor. run(@NotNull Runnable runnable)<T> @NotNull Promise<T>AbstractAsyncCloseable. sanitize(Promise<T> promise)<T> @NotNull Promise<T>AbstractAsyncCloseable. sanitize(T value, @Nullable Throwable e)@NotNull Promise<Void>AsyncProcess. startProcess()Methods in io.activej.async.process with parameters of type Promise Modifier and Type Method Description <T> @NotNull Promise<T>AbstractAsyncCloseable. sanitize(Promise<T> promise) -
Uses of Promise in io.activej.async.service
Methods in io.activej.async.service that return Promise Modifier and Type Method Description @NotNull Promise<?>EventloopService. start()Starts this component asynchronously.@NotNull Promise<Void>EventloopTaskScheduler. start()@NotNull Promise<?>EventloopService. stop()Stops this component asynchronously.@NotNull Promise<Void>EventloopTaskScheduler. stop() -
Uses of Promise in io.activej.promise
Classes in io.activej.promise that implement Promise Modifier and Type Class Description classCompleteExceptionallyPromise<T>Represents aPromisewhich is completed with an exception.classCompleteNullPromise<T>Represents aCompletePromisewith result that equalsnull.classCompletePromise<T>Represents a completedPromisewith a result of unspecified type.classCompleteResultPromise<T>Represents aCompletePromisewith a result of unspecified type.classNextPromise<T,R>Helps to create sequent chains ofPromises.classSettablePromise<T>Represents aPromisewhich can be completed or completedExceptionally manually at once or later in the future.Methods in io.activej.promise with type parameters of type Promise Modifier and Type Method Description <U,S extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>CompleteExceptionallyPromise. next(S promise)<U,S extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>CompletePromise. next(S promise)<U,P extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>Promise. next(P promise)Executes givenpromiseafter execution of thisPromisecompletes.Methods in io.activej.promise that return Promise Modifier and Type Method Description static @NotNull Promise<Void>Promises. all()static @NotNull Promise<Void>Promises. all(@NotNull Promise<?> promise1)static @NotNull Promise<Void>Promises. all(@NotNull Promise<?>... promises)static @NotNull Promise<Void>Promises. all(@NotNull Promise<?> promise1, @NotNull Promise<?> promise2)Optimized for 2 promises.static @NotNull Promise<Void>Promises. all(@NotNull Iterator<? extends Promise<?>> promises)ReturnsPromisethat completes when all of thepromisesare completed.static @NotNull Promise<Void>Promises. all(@NotNull List<? extends Promise<?>> promises)Returns aPromisethat completes when all of thepromisesare completed.static @NotNull Promise<Void>Promises. all(@NotNull Stream<? extends Promise<?>> promises)static <T> @NotNull Promise<T>Promises. any()Returns aCompleteExceptionallyPromisewithException, since this method doesn't accept anyPromisesstatic <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T> promise1)static <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)Optimized for 2 promises.static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T> promise1)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull List<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Stream<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull List<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Stream<? extends Promise<? extends T>> promises)@NotNull Promise<T>CompleteExceptionallyPromise. async()@NotNull Promise<T>CompletePromise. async()@NotNull Promise<T>Promise. async()Ensures thatPromisecompletes asynchronously: if thisPromiseis already completed, its completion will be posted to next eventloop tick.@NotNull Promise<Void>CompleteExceptionallyPromise. both(@NotNull Promise<?> other)@NotNull Promise<Void>CompletePromise. both(@NotNull Promise<?> other)@NotNull Promise<Void>Promise. both(@NotNull Promise<?> other)Returns a newPromisewhen both this and providedotherPromisescomplete.<U,V>
@NotNull Promise<V>CompleteExceptionallyPromise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)<U,V>
@NotNull Promise<V>CompletePromise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)<U,V>
@NotNull Promise<V>Promise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)Returns a newPromisethat, when this and the other givenPromiseboth complete, is executed with the two results as arguments to the supplied function.static @NotNull Promise<Void>Promises. delay(long delayMillis)static <T> @NotNull Promise<T>Promises. delay(long delayMillis, @NotNull Promise<T> promise)Delays completion of providedpromisefor the defined period of time.static <T> @NotNull Promise<T>Promises. delay(long delayMillis, T value)static @NotNull Promise<Void>Promises. delay(@NotNull Duration delay)static <T> @NotNull Promise<T>Promises. delay(@NotNull Duration delay, @NotNull Promise<T> promise)static <T> @NotNull Promise<T>Promises. delay(@NotNull Duration delay, T value)@NotNull Promise<T>CompleteExceptionallyPromise. either(@NotNull Promise<? extends T> other)@NotNull Promise<T>CompletePromise. either(@NotNull Promise<? extends T> other)@NotNull Promise<T>Promise. either(@NotNull Promise<? extends T> other)Returns thePromisewhich was completed first.static <T> @NotNull Promise<T>Promises. first(@NotNull Iterable<? extends AsyncSupplier<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull BiPredicate<? super T,? super Throwable> predicate, @NotNull AsyncSupplier<? extends T>... promises)static <T> @NotNull Promise<T>Promises. first(@NotNull BiPredicate<? super T,? super Throwable> predicate, @NotNull Iterable<? extends AsyncSupplier<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull BiPredicate<? super T,? super Throwable> predicate, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull BiPredicate<? super T,? super Throwable> predicate, @NotNull Stream<? extends AsyncSupplier<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull Stream<? extends AsyncSupplier<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(AsyncSupplier<? extends T>... promises)Picks the firstPromisethat was completed without exception.Promise<V>ResultWithPromise. getPromise()static <T> @NotNull Promise<T>Promises. interval(long intervalMillis, @NotNull Promise<T> promise)static <T> @NotNull Promise<T>Promises. interval(@NotNull Duration interval, @NotNull Promise<T> promise)static <T> Promise<T>Promises. loop(T seed, @NotNull Predicate<T> loopCondition, @NotNull Function<T,Promise<T>> next)<U> @NotNull Promise<U>CompleteExceptionallyPromise. map(@NotNull Function<? super T,? extends U> fn)<U> @NotNull Promise<U>CompletePromise. map(@NotNull Function<? super T,? extends U> fn)<U> @NotNull Promise<U>Promise. map(@NotNull Function<? super T,? extends U> fn)Returns a newPromisewhich is executed with thisPromise's result as the argument to the provided function when thisPromisecompletes successfully.<U> @NotNull Promise<U>CompleteExceptionallyPromise. mapEx(@NotNull BiFunction<? super T,Throwable,? extends U> fn)<U> @NotNull Promise<U>CompletePromise. mapEx(@NotNull BiFunction<? super T,Throwable,? extends U> fn)<U> @NotNull Promise<U>Promise. mapEx(@NotNull BiFunction<? super T,@Nullable Throwable,? extends U> fn)Returns a newPromisewhich is executed with thisPromise's result as the argument to the provided function when thisPromisecompletes either successfully (whenexceptionisnull) or with an exception.<U,S extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>CompleteExceptionallyPromise. next(S promise)<U,S extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>CompletePromise. next(S promise)<U,P extends Callback<? super T> & Promise<U>>
@NotNull Promise<U>Promise. next(P promise)Executes givenpromiseafter execution of thisPromisecompletes.static <T> @NotNull Promise<T>Promise. of(T value, @Nullable Throwable e)Creates a completedPromisefromT valueandThrowable eparameters, any of them can benull.static <T> Promise<T>Promise. ofBlockingCallable(@NotNull Executor executor, @NotNull Promise.BlockingCallable<? extends T> callable)Runs some task in another thread (executed by a givenExecutor) and returns aPromisefor it.static @NotNull Promise<Void>Promise. ofBlockingRunnable(@NotNull Executor executor, @NotNull Promise.BlockingRunnable runnable)Same asofBlockingCallable(Executor, BlockingCallable), but without a result (returnedPromiseis only a marker of completion).static <T> @NotNull Promise<T>Promise. ofCallback(@NotNull Consumer<@NotNull SettablePromise<T>> callbackConsumer)Creates and returns a newSettablePromisethat is accepted by the providedConsumerofSettablePromisestatic <T> @NotNull Promise<T>Promise. ofCompletionStage(CompletionStage<? extends T> completionStage)Wraps JavaCompletionStagein aPromise, running it in current eventloop.static <T> @NotNull Promise<T>Promise. ofFuture(@NotNull CompletableFuture<? extends T> future)Creates aPromisewrapper around default JavaCompletableFutureand runs it immediately.static <T> @NotNull Promise<T>Promise. ofFuture(@NotNull Executor executor, @NotNull Future<? extends T> future)static <T> @NotNull Promise<T>Promise. ofOptional(@NotNull Optional<T> optional)static <T> @NotNull Promise<T>Promise. ofOptional(@NotNull Optional<T> optional, @NotNull Supplier<? extends Throwable> errorSupplier)Creates a newPromiseof the given value.static <T> @NotNull Promise<T>Promise. ofTry(@NotNull io.activej.common.collection.Try<T> t)default @NotNull Promise<T>Promise. post()Promise<T>Promisable. promise()default Promise<T>Promise. promise()static <T,A,R>
Promise<R>Promises. reduce(@NotNull Collector<T,A,R> collector, int maxCalls, @NotNull Iterator<Promise<T>> promises)static <T,A,R>
Promise<R>Promises. reduce(A accumulator, @NotNull BiConsumer<A,T> consumer, @NotNull Function<A,R> finisher, int maxCalls, @NotNull Iterator<Promise<T>> promises)static @NotNull Promise<Void>Promises. repeat(@NotNull Supplier<Promise<Boolean>> supplier)Repeats the operations of providedsupplierinfinitely, until one of thePromises completes exceptionally.static <T> Promise<T>Promises. retry(AsyncSupplier<T> asyncSupplier)static <T> Promise<T>Promises. retry(AsyncSupplier<T> asyncSupplier, @NotNull RetryPolicy<?> retryPolicy)static <T> Promise<T>Promises. retry(AsyncSupplier<T> asyncSupplier, BiPredicate<T,Throwable> breakCondition, @NotNull RetryPolicy<?> retryPolicy)static <T> Promise<T>Promises. retry(BiPredicate<T,Throwable> breakCondition, AsyncSupplier<T> asyncSupplier)static @NotNull Promise<Void>Promises. schedule(long timestamp)static <T> @NotNull Promise<T>Promises. schedule(@NotNull Promise<T> promise, long timestamp)Schedules completion of thePromiseso that it will be completed after the timestamp even if its operations were completed earlier.static <T> @NotNull Promise<T>Promises. schedule(@NotNull Promise<T> promise, @NotNull Instant instant)static @NotNull Promise<Void>Promises. schedule(@NotNull Instant instant)static <T> @NotNull Promise<T>Promises. schedule(T value, long timestamp)static <T> @NotNull Promise<T>Promises. schedule(T value, @NotNull Instant instant)static @NotNull Promise<Void>Promises. sequence()Returns aCompleteNullPromisestatic @NotNull Promise<Void>Promises. sequence(@NotNull AsyncSupplier<Void> promise)GetsPromisefrom providedAsyncSupplier, waits until it completes and than returns aPromise<Void>static @NotNull Promise<Void>Promises. sequence(@NotNull AsyncSupplier<Void>... promises)static @NotNull Promise<Void>Promises. sequence(@NotNull AsyncSupplier<Void> promise1, @NotNull AsyncSupplier<Void> promise2)GetsPromises from providedAsyncSuppliers, end executes them consequently, discarding their results.static @NotNull Promise<Void>Promises. sequence(@NotNull Iterable<? extends AsyncSupplier<Void>> promises)static @NotNull Promise<Void>Promises. sequence(@NotNull Iterator<? extends Promise<Void>> promises)Calls everyPromisefrompromisesin sequence and discards their results.Returns aSettablePromisewithnullresult as a marker when all of thepromisesare completed.static @NotNull Promise<Void>Promises. sequence(@NotNull Stream<? extends AsyncSupplier<Void>> promises)<U> @NotNull Promise<U>CompleteExceptionallyPromise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompleteExceptionallyPromise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>Promise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)Returns a newPromisewhich, when thisPromisecompletes successfully, is executed with thisPromise'sresult as the argument to the supplied function.<U> @NotNull Promise<U>Promise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompleteExceptionallyPromise. thenEx(@NotNull BiFunction<? super T,Throwable,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. thenEx(@NotNull BiFunction<? super T,Throwable,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>Promise. thenEx(@NotNull BiFunction<? super T,@Nullable Throwable,? extends Promise<? extends U>> fn)Returns a newPromisewhich, when thisPromisecompletes either successfully (if exception isnull) or exceptionally (if exception is notnull), is executed with thisPromise'sresult as the argument to the supplied function.static <T> @NotNull Promise<T>Promises. timeout(long delay, @NotNull Promise<T> promise)Waits until the delay passes and if thePromiseis still not complete, tries to complete it withTIMEOUT_EXCEPTION.static <T> @NotNull Promise<T>Promises. timeout(@NotNull Duration delay, @NotNull Promise<T> promise)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type)Returns an array of providedtypeand length 0 wrapped inPromise.static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T> promise1)Returns an array withpromise1result.static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)Returns an array withpromise1andpromise2results.static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Iterable<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull List<? extends Promise<? extends T>> promises)Reduces promises into Promise<Array>static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Stream<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList()Returns a successfully completedPromisewith an empty list as the result.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T> promise1)Returns a completedPromisewith a result wrapped inList.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)ReturnsPromisewith a list ofpromise1andpromise2results.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Iterable<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull List<? extends Promise<? extends T>> promises)Reduces list ofPromises into Promise<List>.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Stream<? extends Promise<? extends T>> promises)@NotNull Promise<io.activej.common.collection.Try<T>>CompleteExceptionallyPromise. toTry()@NotNull Promise<io.activej.common.collection.Try<T>>CompletePromise. toTry()@NotNull Promise<io.activej.common.collection.Try<T>>Promise. toTry()ReturnsPromisethat always completes successfully with result or exception wrapped inTry.static <T1,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor1<T1,R> constructor, @NotNull Promise<? extends T1> promise1)static <T1,T2,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor2<T1,T2,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2)static <T1,T2,T3,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor3<T1,T2,T3,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3)static <T1,T2,T3,T4,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor4<T1,T2,T3,T4,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4)static <T1,T2,T3,T4,T5,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor5<T1,T2,T3,T4,T5,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5)static <T1,T2,T3,T4,T5,T6,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor6<T1,T2,T3,T4,T5,T6,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5, @NotNull Promise<? extends T6> promise6)static <T1> @NotNull Promise<io.activej.common.tuple.Tuple1<T1>>Promises. toTuple(@NotNull Promise<? extends T1> promise1)static <T1,T2>
@NotNull Promise<io.activej.common.tuple.Tuple2<T1,T2>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2)static <T1,T2,T3>
@NotNull Promise<io.activej.common.tuple.Tuple3<T1,T2,T3>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3)static <T1,T2,T3,T4>
@NotNull Promise<io.activej.common.tuple.Tuple4<T1,T2,T3,T4>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4)static <T1,T2,T3,T4,T5>
@NotNull Promise<io.activej.common.tuple.Tuple5<T1,T2,T3,T4,T5>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5)static <T1,T2,T3,T4,T5,T6>
@NotNull Promise<io.activej.common.tuple.Tuple6<T1,T2,T3,T4,T5,T6>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5, @NotNull Promise<? extends T6> promise6)@NotNull Promise<Void>CompleteExceptionallyPromise. toVoid()@NotNull Promise<Void>CompletePromise. toVoid()@NotNull Promise<Void>Promise. toVoid()Waits for result and discards it.static <T> Promise<T>Promises. until(T seed, @NotNull Function<T,Promise<T>> next, @NotNull Predicate<T> breakCondition)@NotNull Promise<T>CompleteExceptionallyPromise. whenComplete(@NotNull Callback<? super T> action)@NotNull Promise<T>CompleteExceptionallyPromise. whenComplete(@NotNull Runnable action)@NotNull Promise<T>CompletePromise. whenComplete(@NotNull Callback<? super T> action)@NotNull Promise<T>CompletePromise. whenComplete(@NotNull Runnable action)@NotNull Promise<T>Promise. whenComplete(@NotNull Callback<? super T> action)Subscribes given action to be executed after thisPromisecompletes and returns a newPromise.@NotNull Promise<T>Promise. whenComplete(@NotNull Runnable action)Subscribes given action to be executed after thisPromisecompletes and returns a newPromise.Promise<T>CompleteExceptionallyPromise. whenException(@NotNull Runnable action)Promise<T>CompleteExceptionallyPromise. whenException(@NotNull Consumer<Throwable> action)Promise<T>CompletePromise. whenException(@NotNull Runnable action)Promise<T>CompletePromise. whenException(@NotNull Consumer<Throwable> action)Promise<T>Promise. whenException(@NotNull Runnable action)Promise<T>Promise. whenException(@NotNull Consumer<Throwable> action)Subscribes given action to be executed after thisPromisecompletes exceptionally and returns a newPromise.Promise<T>CompleteExceptionallyPromise. whenResult(@NotNull Runnable action)@NotNull Promise<T>CompleteExceptionallyPromise. whenResult(@NotNull Consumer<? super T> action)Promise<T>CompletePromise. whenResult(@NotNull Runnable action)@NotNull Promise<T>CompletePromise. whenResult(@NotNull Consumer<? super T> action)Promise<T>Promise. whenResult(@NotNull Runnable action)@NotNull Promise<T>Promise. whenResult(Consumer<? super T> action)Subscribes given action to be executed after thisPromisecompletes successfully and returns a newPromise.Methods in io.activej.promise that return types with arguments of type Promise Modifier and Type Method Description static <T> Iterator<Promise<T>>Promises. asPromises(@NotNull AsyncSupplier<? extends T>... tasks)static <T> Iterator<Promise<T>>Promises. asPromises(@NotNull Iterable<? extends AsyncSupplier<? extends T>> tasks)static <T> @NotNull Iterator<Promise<T>>Promises. asPromises(@NotNull Iterator<? extends AsyncSupplier<? extends T>> tasks)static <T> Iterator<Promise<T>>Promises. asPromises(@NotNull Stream<? extends AsyncSupplier<? extends T>> tasks)static <T,A,R>
@NotNull Function<T,Promise<R>>Promises. coalesce(@NotNull Supplier<A> argumentAccumulatorSupplier, @NotNull BiConsumer<A,T> argumentAccumulatorFn, @NotNull Function<A,Promise<R>> fn)static <T,T1,R,R1>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor1<R1,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1)static <T,T1,T2,R,R1,R2>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor2<R1,R2,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1, @NotNull Function<? super T,T2> getter2, Function<T2,? extends Promise<R2>> fn2)static <T,T1,T2,T3,R,R1,R2,R3>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor3<R1,R2,R3,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1, @NotNull Function<? super T,T2> getter2, Function<T2,? extends Promise<R2>> fn2, @NotNull Function<? super T,T3> getter3, Function<T3,? extends Promise<R3>> fn3)static <T,T1,T2,T3,T4,R,R1,R2,R3,R4>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor4<R1,R2,R3,R4,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1, @NotNull Function<? super T,T2> getter2, Function<T2,? extends Promise<R2>> fn2, @NotNull Function<? super T,T3> getter3, Function<T3,? extends Promise<R3>> fn3, @NotNull Function<? super T,T4> getter4, Function<T4,? extends Promise<R4>> fn4)static <T,T1,T2,T3,T4,T5,R,R1,R2,R3,R4,R5>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor5<R1,R2,R3,R4,R5,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1, @NotNull Function<? super T,T2> getter2, Function<T2,? extends Promise<R2>> fn2, @NotNull Function<? super T,T3> getter3, Function<T3,? extends Promise<R3>> fn3, @NotNull Function<? super T,T4> getter4, Function<T4,? extends Promise<R4>> fn4, @NotNull Function<? super T,T5> getter5, Function<T5,? extends Promise<R5>> fn5)static <T,T1,T2,T3,T4,T5,T6,R,R1,R2,R3,R4,R5,R6>
@NotNull Function<T,Promise<R>>Promises. mapTuple(@NotNull io.activej.common.tuple.TupleConstructor6<R1,R2,R3,R4,R5,R6,R> constructor, @NotNull Function<? super T,T1> getter1, Function<T1,? extends Promise<R1>> fn1, @NotNull Function<? super T,T2> getter2, Function<T2,? extends Promise<R2>> fn2, @NotNull Function<? super T,T3> getter3, Function<T3,? extends Promise<R3>> fn3, @NotNull Function<? super T,T4> getter4, Function<T4,? extends Promise<R4>> fn4, @NotNull Function<? super T,T5> getter5, Function<T5,? extends Promise<R5>> fn5, @NotNull Function<? super T,T6> getter6, Function<T6,? extends Promise<R6>> fn6)Methods in io.activej.promise with parameters of type Promise Modifier and Type Method Description static @NotNull Promise<Void>Promises. all(@NotNull Promise<?> promise1)static @NotNull Promise<Void>Promises. all(@NotNull Promise<?>... promises)static @NotNull Promise<Void>Promises. all(@NotNull Promise<?> promise1, @NotNull Promise<?> promise2)Optimized for 2 promises.static <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T> promise1)static <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)Optimized for 2 promises.static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T> promise1)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)static <T> TTestUtils. await(Promise<T> promise)static <T> VoidTestUtils. await(Promise<T>... promises)static <T,E extends Throwable>
ETestUtils. awaitException(Promise<T> promise)static <T,E extends Throwable>
ETestUtils. awaitException(Promise<T>... promises)@NotNull Promise<Void>CompleteExceptionallyPromise. both(@NotNull Promise<?> other)@NotNull Promise<Void>CompletePromise. both(@NotNull Promise<?> other)@NotNull Promise<Void>Promise. both(@NotNull Promise<?> other)Returns a newPromisewhen both this and providedotherPromisescomplete.<U,V>
@NotNull Promise<V>CompleteExceptionallyPromise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)<U,V>
@NotNull Promise<V>CompletePromise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)<U,V>
@NotNull Promise<V>Promise. combine(@NotNull Promise<? extends U> other, @NotNull BiFunction<? super T,? super U,? extends V> fn)Returns a newPromisethat, when this and the other givenPromiseboth complete, is executed with the two results as arguments to the supplied function.static <T> @NotNull Promise<T>Promises. delay(long delayMillis, @NotNull Promise<T> promise)Delays completion of providedpromisefor the defined period of time.static <T> @NotNull Promise<T>Promises. delay(@NotNull Duration delay, @NotNull Promise<T> promise)@NotNull Promise<T>CompleteExceptionallyPromise. either(@NotNull Promise<? extends T> other)@NotNull Promise<T>CompletePromise. either(@NotNull Promise<? extends T> other)@NotNull Promise<T>Promise. either(@NotNull Promise<? extends T> other)Returns thePromisewhich was completed first.static <T> @NotNull Promise<T>Promises. interval(long intervalMillis, @NotNull Promise<T> promise)static <T> @NotNull Promise<T>Promises. interval(@NotNull Duration interval, @NotNull Promise<T> promise)static <T,V>
ResultWithPromise<T,V>ResultWithPromise. of(T result, Promise<V> promise)static <T> @NotNull Promise<T>Promises. schedule(@NotNull Promise<T> promise, long timestamp)Schedules completion of thePromiseso that it will be completed after the timestamp even if its operations were completed earlier.static <T> @NotNull Promise<T>Promises. schedule(@NotNull Promise<T> promise, @NotNull Instant instant)static <T> @NotNull Promise<T>Promises. timeout(long delay, @NotNull Promise<T> promise)Waits until the delay passes and if thePromiseis still not complete, tries to complete it withTIMEOUT_EXCEPTION.static <T> @NotNull Promise<T>Promises. timeout(@NotNull Duration delay, @NotNull Promise<T> promise)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T> promise1)Returns an array withpromise1result.static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)Returns an array withpromise1andpromise2results.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T> promise1)Returns a completedPromisewith a result wrapped inList.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T>... promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Promise<? extends T> promise1, @NotNull Promise<? extends T> promise2)ReturnsPromisewith a list ofpromise1andpromise2results.static <T1,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor1<T1,R> constructor, @NotNull Promise<? extends T1> promise1)static <T1,T2,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor2<T1,T2,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2)static <T1,T2,T3,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor3<T1,T2,T3,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3)static <T1,T2,T3,T4,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor4<T1,T2,T3,T4,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4)static <T1,T2,T3,T4,T5,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor5<T1,T2,T3,T4,T5,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5)static <T1,T2,T3,T4,T5,T6,R>
@NotNull Promise<R>Promises. toTuple(@NotNull io.activej.common.tuple.TupleConstructor6<T1,T2,T3,T4,T5,T6,R> constructor, @NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5, @NotNull Promise<? extends T6> promise6)static <T1> @NotNull Promise<io.activej.common.tuple.Tuple1<T1>>Promises. toTuple(@NotNull Promise<? extends T1> promise1)static <T1,T2>
@NotNull Promise<io.activej.common.tuple.Tuple2<T1,T2>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2)static <T1,T2,T3>
@NotNull Promise<io.activej.common.tuple.Tuple3<T1,T2,T3>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3)static <T1,T2,T3,T4>
@NotNull Promise<io.activej.common.tuple.Tuple4<T1,T2,T3,T4>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4)static <T1,T2,T3,T4,T5>
@NotNull Promise<io.activej.common.tuple.Tuple5<T1,T2,T3,T4,T5>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5)static <T1,T2,T3,T4,T5,T6>
@NotNull Promise<io.activej.common.tuple.Tuple6<T1,T2,T3,T4,T5,T6>>Promises. toTuple(@NotNull Promise<? extends T1> promise1, @NotNull Promise<? extends T2> promise2, @NotNull Promise<? extends T3> promise3, @NotNull Promise<? extends T4> promise4, @NotNull Promise<? extends T5> promise5, @NotNull Promise<? extends T6> promise6)Method parameters in io.activej.promise with type arguments of type Promise Modifier and Type Method Description static @NotNull Promise<Void>Promises. all(@NotNull Iterator<? extends Promise<?>> promises)ReturnsPromisethat completes when all of thepromisesare completed.static @NotNull Promise<Void>Promises. all(@NotNull List<? extends Promise<?>> promises)Returns aPromisethat completes when all of thepromisesare completed.static @NotNull Promise<Void>Promises. all(@NotNull Stream<? extends Promise<?>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull List<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull BiPredicate<T,Throwable> predicate, @NotNull Stream<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull List<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. any(@NotNull Stream<? extends Promise<? extends T>> promises)static <T,A,R>
@NotNull Function<T,Promise<R>>Promises. coalesce(@NotNull Supplier<A> argumentAccumulatorSupplier, @NotNull BiConsumer<A,T> argumentAccumulatorFn, @NotNull Function<A,Promise<R>> fn)static <T> @NotNull Promise<T>Promises. first(@NotNull BiPredicate<? super T,? super Throwable> predicate, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T>Promises. first(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> Promise<T>Promises. loop(T seed, @NotNull Predicate<T> loopCondition, @NotNull Function<T,Promise<T>> next)static <T,A,R>
Promise<R>Promises. reduce(@NotNull Collector<T,A,R> collector, int maxCalls, @NotNull Iterator<Promise<T>> promises)static <T,A,R>
Promise<R>Promises. reduce(A accumulator, @NotNull BiConsumer<A,T> consumer, @NotNull Function<A,R> finisher, int maxCalls, @NotNull Iterator<Promise<T>> promises)static @NotNull Promise<Void>Promises. repeat(@NotNull Supplier<Promise<Boolean>> supplier)Repeats the operations of providedsupplierinfinitely, until one of thePromises completes exceptionally.static @NotNull Promise<Void>Promises. sequence(@NotNull Iterator<? extends Promise<Void>> promises)Calls everyPromisefrompromisesin sequence and discards their results.Returns aSettablePromisewithnullresult as a marker when all of thepromisesare completed.<U> @NotNull Promise<U>CompleteExceptionallyPromise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompleteExceptionallyPromise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>Promise. then(@NotNull Function<? super T,? extends Promise<? extends U>> fn)Returns a newPromisewhich, when thisPromisecompletes successfully, is executed with thisPromise'sresult as the argument to the supplied function.<U> @NotNull Promise<U>Promise. then(@NotNull Supplier<? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompleteExceptionallyPromise. thenEx(@NotNull BiFunction<? super T,Throwable,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>CompletePromise. thenEx(@NotNull BiFunction<? super T,Throwable,? extends Promise<? extends U>> fn)<U> @NotNull Promise<U>Promise. thenEx(@NotNull BiFunction<? super T,@Nullable Throwable,? extends Promise<? extends U>> fn)Returns a newPromisewhich, when thisPromisecompletes either successfully (if exception isnull) or exceptionally (if exception is notnull), is executed with thisPromise'sresult as the argument to the supplied function.static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Iterable<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull List<? extends Promise<? extends T>> promises)Reduces promises into Promise<Array>static <T> @NotNull Promise<T[]>Promises. toArray(@NotNull Class<T> type, @NotNull Stream<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Iterable<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Iterator<? extends Promise<? extends T>> promises)static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull List<? extends Promise<? extends T>> promises)Reduces list ofPromises into Promise<List>.static <T> @NotNull Promise<List<T>>Promises. toList(@NotNull Stream<? extends Promise<? extends T>> promises)static <T> Promise<T>Promises. until(T seed, @NotNull Function<T,Promise<T>> next, @NotNull Predicate<T> breakCondition) -
Uses of Promise in io.activej.promise.jmx
Methods in io.activej.promise.jmx that return Promise Modifier and Type Method Description <T> Promise<T>PromiseStats. monitor(Promise<T> promise)Methods in io.activej.promise.jmx with parameters of type Promise Modifier and Type Method Description <T> Promise<T>PromiseStats. monitor(Promise<T> promise)
-