Uses of Interface
io.activej.promise.Promise
Packages that use Promise
Package
Description
-
Uses of Promise in io.activej.async
Methods in io.activej.async that return PromiseModifier and TypeMethodDescription<V,T> Promise<T> AsyncBuffer.add(BiConsumer<A, V> argumentAccumulator, io.activej.common.function.FunctionEx<R, T> resultExtractor, V argument) AsyncBuffer.add(BiConsumer<A, V> argumentAccumulator, V argument) AsyncBuffer.flush()AsyncAccumulator.get()AsyncBuffer.getBufferedPromise()AsyncAccumulator.run()Methods in io.activej.async with parameters of type PromiseModifier and TypeMethodDescription<T> voidAsyncAccumulator.addPromise(Promise<T> promise, io.activej.common.function.BiConsumerEx<A, T> consumer) <T> AsyncAccumulator<A>.BuilderAsyncAccumulator.Builder.withPromise(Promise<T> promise, io.activej.common.function.BiConsumerEx<A, T> accumulator) -
Uses of Promise in io.activej.async.file
Methods in io.activej.async.file that return PromiseModifier and TypeMethodDescriptionExecutorFileService.read(FileChannel channel, long position, byte[] array, int offset, int size) IFileService.read(FileChannel channel, long position, byte[] array, int offset, int size) ExecutorFileService.write(FileChannel channel, long position, byte[] array, int offset, int size) IFileService.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 -
Uses of Promise in io.activej.async.process
Methods in io.activej.async.process that return PromiseModifier and TypeMethodDescriptiondefault <T> Promise<T>protected final <T> Promise<T>AbstractAsyncCloseable.doSanitize(T value, @Nullable Exception e) <T> Promise<T>AsyncExecutor.execute(AsyncSupplier<T> supplier) ReactiveProcess.getProcessCompletion()final <T> Promise<T>ReactiveProcess.startProcess()Methods in io.activej.async.process with parameters of type Promise -
Uses of Promise in io.activej.async.service
Methods in io.activej.async.service that return Promise -
Uses of Promise in io.activej.promise
Classes in io.activej.promise that implement PromiseModifier and TypeClassDescriptionclassstatic final classstatic classstatic classfinal classRepresents aPromisewhich is completed with an exception.final classRepresents aCompletePromisewith result that equalsnull.classRepresents a completedPromisewith a result of unspecified type.final classRepresents aCompletePromisewith a result of unspecified type.classNextPromise<T,R> Helps to create sequent chains ofPromises.final classRepresents aPromisewhich can be completed or completedExceptionally manually at once or later in the future.Methods in io.activej.promise that return PromiseModifier and TypeMethodDescriptionPromises.all()Optimized for 2 promises.ReturnsPromisethat completes when all of thepromisesare completed.Returns aPromisethat completes when all of thepromisesare completed.static <T> Promise<T>Promises.any()Returns aCompleteExceptionallyPromisewithException, since this method doesn't accept anyPromisesstatic <T> Promise<T>static <T> Promise<T>static <T> Promise<T>Optimized for 2 promises.static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T> promise1) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T>... promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T> promise1, Promise<? extends T> promise2) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Iterator<? extends Promise<? extends T>> promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, List<? extends Promise<? extends T>> promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Stream<? extends Promise<? extends T>> promises) static <T> Promise<T>static <T> Promise<T>static <T> Promise<T>AbstractPromise.async()CompleteExceptionallyPromise.async()CompletePromise.async()Promise.async()Ensures thatPromisecompletes asynchronously: if thisPromiseis already completed, its completion will be posted to the next reactor tick.Returns a newPromisewhen both this and providedotherPromisescomplete.default <U> Promise<U>Promise.cast()Caststhispromise to a promise of some other typePromisedefault <U> Promise<U>Caststhispromise to a promise of some other typePromise<U,V> Promise<V> AbstractPromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) <U,V> Promise<V> CompleteExceptionallyPromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) final <U,V> Promise<V> CompletePromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) <U,V> Promise<V> Promise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? 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.Promise.complete()Creates successfully completedPromisePromises.delay(long delayMillis) static <T> Promise<T>Delays completion of providedpromisefor the defined period of time.static <T> Promise<T>Promises.delay(long delayMillis, T value) Promises.delay(ReactorScheduler reactor, long delayMillis) static <T> Promise<T>Promises.delay(ReactorScheduler reactor, long delayMillis, Promise<T> promise) static <T> Promise<T>Promises.delay(ReactorScheduler reactor, long delayMillis, T value) Promises.delay(ReactorScheduler reactor, Duration delay) static <T> Promise<T>Promises.delay(ReactorScheduler reactor, Duration delay, Promise<T> promise) static <T> Promise<T>Promises.delay(ReactorScheduler reactor, Duration delay, T value) static <T> Promise<T>static <T> Promise<T>Returns thePromisewhich was completed first.static <T> Promise<T>Promises.first(AsyncSupplier<? extends T>... promises) Picks the firstPromisethat was completed without exception.static <T> Promise<T>Promises.first(Iterable<? extends AsyncSupplier<? extends T>> promises) static <T> Promise<T>Promises.first(BiPredicate<? super T, ? super Exception> predicate, AsyncSupplier<? extends T>... promises) static <T> Promise<T>Promises.first(BiPredicate<? super T, ? super Exception> predicate, Iterable<? extends AsyncSupplier<? extends T>> promises) static <T> Promise<T>Promises.first(BiPredicate<? super T, ? super Exception> predicate, Iterator<? extends Promise<? extends T>> promises) static <T> Promise<T>Promises.first(BiPredicate<? super T, ? super Exception> predicate, Stream<? extends AsyncSupplier<? extends T>> promises) static <T> Promise<T>static <T> Promise<T>Promises.first(Stream<? extends AsyncSupplier<? extends T>> promises) ResultWithPromise.getPromise()static <T> Promise<T>static <T> Promise<T>Promises.interval(ReactorScheduler reactor, long intervalMillis, Promise<T> promise) static <T> Promise<T>Promises.interval(ReactorScheduler reactor, Duration interval, Promise<T> promise) static <T> Promise<T>static <T> Promise<T>Promises.loop(T seed, Predicate<T> loopCondition, io.activej.common.function.FunctionEx<T, Promise<T>> next) Repeats providedFunctionExuntil can passPredicatetest.<U> Promise<U><U> Promise<U><U> Promise<U>AbstractPromise.map(io.activej.common.function.FunctionEx<? super T, ? extends U> fn, io.activej.common.function.FunctionEx<Exception, ? extends U> exceptionFn) <U> Promise<U>CompleteExceptionallyPromise.map(io.activej.common.function.BiFunctionEx<? super T, Exception, ? extends U> fn) <U> Promise<U><U> Promise<U>CompleteExceptionallyPromise.map(io.activej.common.function.FunctionEx<? super T, ? extends U> fn, io.activej.common.function.FunctionEx<Exception, ? extends U> exceptionFn) final <U> Promise<U>final <U> Promise<U><U> Promise<U>CompletePromise.map(io.activej.common.function.FunctionEx<? super T, ? extends U> fn, io.activej.common.function.FunctionEx<Exception, ? extends U> exceptionFn) default <U> Promise<U>Returns a newPromisewhich is obtained by mapping a result and an exception ofthispromise to some other value.default <U> Promise<U>Returns a newPromisewhich is obtained by mapping a result ofthispromise to some other value.default <U> Promise<U>Promise.map(io.activej.common.function.FunctionEx<? super T, ? extends U> fn, io.activej.common.function.FunctionEx<Exception, ? extends U> exceptionFn) Returns a newPromisewhich is obtained by mapping either a result or an exception ofthispromise to some other values.AbstractPromise.mapException(io.activej.common.function.FunctionEx<Exception, Exception> exceptionFn) AbstractPromise.mapException(Class<E> clazz, io.activej.common.function.FunctionEx<? super E, ? extends Exception> exceptionFn) CompleteExceptionallyPromise.mapException(io.activej.common.function.FunctionEx<Exception, Exception> exceptionFn) CompleteExceptionallyPromise.mapException(Class<E> clazz, io.activej.common.function.FunctionEx<? super E, ? extends Exception> exceptionFn) CompletePromise.mapException(io.activej.common.function.FunctionEx<Exception, Exception> exceptionFn) CompletePromise.mapException(Class<E> clazz, io.activej.common.function.FunctionEx<? super E, ? extends Exception> exceptionFn) Promise.mapException(io.activej.common.function.FunctionEx<Exception, Exception> exceptionFn) Returns a newPromisewhich is obtained by mapping an exception ofthispromise to some other exception.Promise.mapException(Class<E> clazz, io.activej.common.function.FunctionEx<? super E, ? extends Exception> exceptionFn) Returns a newPromisewhich is obtained by mapping an exception ofthispromise to some other exception.static <T> Promise<T>Promise.of(T value) Creates successfully completedPromise.static <T> Promise<T>Creates a completedPromisefromT valueandException eparameters, any of them can benull.Promise.ofBlocking(Executor executor, io.activej.common.function.RunnableEx runnable) Same asofBlocking(Executor, SupplierEx), but without a result (returnedPromiseis only a marker of completion).static <T> Promise<T>Promise.ofBlocking(Executor executor, io.activej.common.function.SupplierEx<? extends T> supplier) Runs some task in another thread (executed by a givenExecutor) and returns aPromisefor it.static <T> Promise<T>Promise.ofCallback(CallbackSupplierEx<T> fn) Creates and returns a newSettablePromisethat is accepted by the providedConsumerExofSettablePromisestatic <T,R> Promise<R> Promise.ofCallback(T value, @Nullable Exception exception, CallbackBiFunctionEx<? super T, @Nullable Exception, R> fn) static <T,R> Promise<R> Promise.ofCallback(T value, @Nullable Exception exception, CallbackFunctionEx<? super T, R> fn, CallbackFunctionEx<Exception, R> fnException) static <T,R> Promise<R> Promise.ofCallback(T value, CallbackFunctionEx<? super T, R> fn) static <T> Promise<T>Promise.ofCompletionStage(CompletionStage<? extends T> completionStage) Wraps JavaCompletionStagein aPromise, running it in current reactor.static <T> Promise<T>Promise.ofException(Exception e) Creates an exceptionally completedPromise.static <T> Promise<T>Promise.ofFuture(CompletableFuture<? extends T> future) Creates aPromisewrapper around default JavaCompletableFutureand runs it immediately.static <T> Promise<T>static <T> Promise<T>Promise.ofOptional(Optional<T> optional) Creates a newPromiseof the given valuestatic <T> Promise<T>Promise.ofOptional(Optional<T> optional, Supplier<? extends Exception> errorSupplier) Creates a newPromiseof the given value.static <T> Promise<T>Promise.ofTry(io.activej.common.collection.Try<T> t) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, int maxCalls, Iterator<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Collection<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Iterator<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Stream<Promise<T>> promises) static <T,A, R> Promise<R> Promises.repeat(AsyncSupplier<Boolean> supplier) Repeats the operations of providedAsyncSupplier<Boolean>infinitely, until one of thePromises completes exceptionally or supplier returns a promise offalse.static <T> Promise<T>Promises.retry(AsyncSupplier<T> supplier) static <T> Promise<T>Promises.retry(AsyncSupplier<T> supplier, RetryPolicy<?> retryPolicy) static <T> Promise<T>Promises.retry(AsyncSupplier<T> supplier, BiPredicate<T, Exception> breakCondition, RetryPolicy<?> retryPolicy) static <T> Promise<T>Promises.retry(BiPredicate<? super T, Exception> breakCondition, AsyncSupplier<T> supplier) Promises.schedule(long timestamp) static <T> Promise<T>Schedules completion of thePromiseso that it will be completed after the timestamp even if its operations were completed earlier.static <T> Promise<T>Promises.schedule(long timestamp, T value) Promises.schedule(ReactorScheduler reactor, long timestamp) static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, long timestamp, Promise<T> promise) static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, long timestamp, T value) Promises.schedule(ReactorScheduler reactor, Instant instant) static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, Instant instant, Promise<T> promise) static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, Instant instant, T value) static <T> Promise<T>static <T> Promise<T>Promises.sequence()Returns aCompleteNullPromisePromises.sequence(AsyncRunnable runnable) Executes anAsyncRunnable, returning aPromise<Void>as a mark for completionPromises.sequence(AsyncRunnable... runnables) Promises.sequence(AsyncRunnable runnable1, AsyncRunnable runnable2) Executes bothAsyncRunnables consequently, returning aPromise<Void>as a mark for completionPromises.sequence(Iterable<? extends AsyncRunnable> runnables) Calls everyPromisefrompromisesin sequence and discards their results.Returns aSettablePromisewithnullresult as a marker when all of thepromisesare completed.Promises.sequence(Stream<? extends AsyncRunnable> runnables) <U> Promise<U>AbstractPromise.then(AsyncBiFunctionEx<? super T, Exception, U> fn) <U> Promise<U>AbstractPromise.then(AsyncFunctionEx<? super T, U> fn) <U> Promise<U>AbstractPromise.then(AsyncFunctionEx<? super T, U> fn, AsyncFunctionEx<Exception, U> exceptionFn) <U> Promise<U>AbstractPromise.then(AsyncSupplierEx<U> fn) <U> Promise<U>CompleteExceptionallyPromise.then(AsyncBiFunctionEx<? super T, Exception, U> fn) <U> Promise<U>CompleteExceptionallyPromise.then(AsyncFunctionEx<? super T, U> fn) <U> Promise<U>CompleteExceptionallyPromise.then(AsyncFunctionEx<? super T, U> fn, AsyncFunctionEx<Exception, U> exceptionFn) <U> Promise<U>CompleteExceptionallyPromise.then(AsyncSupplierEx<U> fn) final <U> Promise<U>CompletePromise.then(AsyncBiFunctionEx<? super T, Exception, U> fn) final <U> Promise<U>CompletePromise.then(AsyncFunctionEx<? super T, U> fn) <U> Promise<U>CompletePromise.then(AsyncFunctionEx<? super T, U> fn, AsyncFunctionEx<Exception, U> exceptionFn) <U> Promise<U>CompletePromise.then(AsyncSupplierEx<U> fn) default <U> Promise<U>Promise.then(AsyncBiFunctionEx<? super T, @Nullable Exception, U> fn) Returns a newPromisewhich is obtained by mapping a result and an exception ofthispromise to some other promise.default <U> Promise<U>Promise.then(AsyncFunctionEx<? super T, U> fn) Returns a newPromisewhich is obtained by mapping a result ofthispromise to some other promise.default <U> Promise<U>Promise.then(AsyncFunctionEx<? super T, U> fn, AsyncFunctionEx<Exception, U> exceptionFn) Returns a newPromisewhich is obtained by mapping either a result or an exception ofthispromise to some other promises.default <U> Promise<U>Promise.then(AsyncSupplierEx<U> fn) Returns a newPromisewhich is obtained by calling a provided supplier of a new promise.<U> Promise<U>AbstractPromise.thenCallback(CallbackBiFunctionEx<? super T, @Nullable Exception, U> fn) <U> Promise<U>AbstractPromise.thenCallback(CallbackFunctionEx<? super T, U> fn) <U> Promise<U>AbstractPromise.thenCallback(CallbackFunctionEx<? super T, U> fn, CallbackFunctionEx<Exception, U> exceptionFn) <U> Promise<U>AbstractPromise.thenCallback(CallbackSupplierEx<U> fn) <U> Promise<U>CompleteExceptionallyPromise.thenCallback(CallbackBiFunctionEx<? super T, @Nullable Exception, U> fn) <U> Promise<U>CompleteExceptionallyPromise.thenCallback(CallbackFunctionEx<? super T, U> fn) <U> Promise<U>CompleteExceptionallyPromise.thenCallback(CallbackFunctionEx<? super T, U> fn, CallbackFunctionEx<Exception, U> exceptionFn) <U> Promise<U>CompleteExceptionallyPromise.thenCallback(CallbackSupplierEx<U> fn) <U> Promise<U>CompletePromise.thenCallback(CallbackBiFunctionEx<? super T, @Nullable Exception, U> fn) <U> Promise<U>CompletePromise.thenCallback(CallbackFunctionEx<? super T, U> fn) <U> Promise<U>CompletePromise.thenCallback(CallbackFunctionEx<? super T, U> fn, CallbackFunctionEx<Exception, U> exceptionFn) <U> Promise<U>CompletePromise.thenCallback(CallbackSupplierEx<U> fn) <U> Promise<U>Promise.thenCallback(CallbackBiFunctionEx<? super T, @Nullable Exception, U> fn) default <U> Promise<U>Promise.thenCallback(CallbackFunctionEx<? super T, U> fn) default <U> Promise<U>Promise.thenCallback(CallbackFunctionEx<? super T, U> fn, CallbackFunctionEx<Exception, U> exceptionFn) default <U> Promise<U>Promise.thenCallback(CallbackSupplierEx<U> fn) static <T> Promise<T>Waits until the delay passes and if thePromiseis still not complete, tries to complete it withTIMEOUT_EXCEPTION.static <T> Promise<T>Promises.timeout(ReactorScheduler reactor, long delay, Promise<T> promise) static <T> Promise<T>Promises.timeout(ReactorScheduler reactor, Duration delay, Promise<T> promise) static <T> Promise<T>static <T> Promise<T[]>Returns an array of providedtypeand length 0 wrapped inPromise.static <T> Promise<T[]>Returns an array withpromise1result.static <T> Promise<T[]>static <T> Promise<T[]>Returns an array withpromise1andpromise2results.static <T> Promise<T[]>static <T> Promise<T[]>static <T> Promise<T[]>Reduces promises into Promise<Array>static <T> Promise<T[]>Promises.toList()Returns a successfully completedPromisewith an empty list as the result.Returns a completedPromisewith a result wrapped inList.ReturnsPromisewith a list ofpromise1andpromise2results.Reduces list ofPromises into Promise<List>.ToPromise.toPromise()AbstractPromise.toTry()CompleteExceptionallyPromise.toTry()CompletePromise.toTry()Promise.toTry()ReturnsPromisethat always completes successfully with result or exception wrapped inTry.static <T1,R> Promise<R> Promises.toTuple(io.activej.common.tuple.TupleConstructor1<T1, R> constructor, Promise<? extends T1> promise1) static <T1,T2, R> Promise<R> Promises.toTuple(io.activej.common.tuple.TupleConstructor2<T1, T2, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2) static <T1,T2, T3, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor3<T1, T2, T3, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3) static <T1,T2, T3, T4, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor4<T1, T2, T3, T4, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4) static <T1,T2, T3, T4, T5, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor5<T1, T2, T3, T4, T5, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5) static <T1,T2, T3, T4, T5, T6, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor6<T1, T2, T3, T4, T5, T6, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5, Promise<? extends T6> promise6) static <T1> Promise<io.activej.common.tuple.Tuple1<T1>>static <T1,T2> Promise<io.activej.common.tuple.Tuple2<T1, T2>> static <T1,T2, T3> Promise<io.activej.common.tuple.Tuple3<T1, T2, T3>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3) static <T1,T2, T3, T4>
Promise<io.activej.common.tuple.Tuple4<T1,T2, T3, T4>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4) static <T1,T2, T3, T4, T5>
Promise<io.activej.common.tuple.Tuple5<T1,T2, T3, T4, T5>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5) static <T1,T2, T3, T4, T5, T6>
Promise<io.activej.common.tuple.Tuple6<T1,T2, T3, T4, T5, T6>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5, Promise<? extends T6> promise6) AbstractPromise.toVoid()CompleteExceptionallyPromise.toVoid()CompletePromise.toVoid()Promise.toVoid()Waits for result and discards it.static <T> Promise<T>Promises.until(T seed, io.activej.common.function.FunctionEx<T, Promise<T>> next, Predicate<T> breakCondition) AbstractPromise.whenComplete(io.activej.common.function.BiConsumerEx<? super T, Exception> fn) AbstractPromise.whenComplete(io.activej.common.function.ConsumerEx<? super T> fn, io.activej.common.function.ConsumerEx<Exception> exceptionFn) AbstractPromise.whenComplete(io.activej.common.function.RunnableEx action) CompleteExceptionallyPromise.whenComplete(io.activej.common.function.BiConsumerEx<? super T, Exception> fn) CompleteExceptionallyPromise.whenComplete(io.activej.common.function.ConsumerEx<? super T> fn, io.activej.common.function.ConsumerEx<Exception> exceptionFn) CompleteExceptionallyPromise.whenComplete(io.activej.common.function.RunnableEx action) CompletePromise.whenComplete(io.activej.common.function.BiConsumerEx<? super T, Exception> fn) CompletePromise.whenComplete(io.activej.common.function.ConsumerEx<? super T> fn, io.activej.common.function.ConsumerEx<Exception> exceptionFn) CompletePromise.whenComplete(io.activej.common.function.RunnableEx action) Promise.whenComplete(io.activej.common.function.BiConsumerEx<? super T, Exception> fn) Subscribes given consumer to be executed after thisPromisecompletes (either successfully or exceptionally).Promise.whenComplete(io.activej.common.function.ConsumerEx<? super T> fn, io.activej.common.function.ConsumerEx<Exception> exceptionFn) Subscribes given consumers to be executed afterthisPromise completes (either successfully or exceptionally).Promise.whenComplete(io.activej.common.function.RunnableEx action) Subscribes given runnable to be executed after thisPromisecompletes (either successfully or exceptionally).AbstractPromise.whenException(io.activej.common.function.ConsumerEx<Exception> fn) AbstractPromise.whenException(io.activej.common.function.RunnableEx action) AbstractPromise.whenException(Class<? extends Exception> clazz, io.activej.common.function.RunnableEx action) AbstractPromise.whenException(Class<E> clazz, io.activej.common.function.ConsumerEx<? super E> fn) CompleteExceptionallyPromise.whenException(io.activej.common.function.ConsumerEx<Exception> fn) CompleteExceptionallyPromise.whenException(io.activej.common.function.RunnableEx action) CompleteExceptionallyPromise.whenException(Class<? extends Exception> clazz, io.activej.common.function.RunnableEx action) CompleteExceptionallyPromise.whenException(Class<E> clazz, io.activej.common.function.ConsumerEx<? super E> fn) CompletePromise.whenException(io.activej.common.function.ConsumerEx<Exception> fn) CompletePromise.whenException(io.activej.common.function.RunnableEx action) CompletePromise.whenException(Class<? extends Exception> clazz, io.activej.common.function.RunnableEx action) CompletePromise.whenException(Class<E> clazz, io.activej.common.function.ConsumerEx<? super E> fn) Promise.whenException(io.activej.common.function.ConsumerEx<Exception> fn) Subscribes given consumer to be executed after thisPromisecompletes exceptionally.Promise.whenException(io.activej.common.function.RunnableEx action) Subscribes given runnable to be executed after thisPromisecompletes exceptionally.Promise.whenException(Class<? extends Exception> clazz, io.activej.common.function.RunnableEx action) Subscribes given runnable to be executed after thisPromisecompletes exceptionally and an exception of thisPromiseis an instance of a given exceptionClass.Promise.whenException(Class<E> clazz, io.activej.common.function.ConsumerEx<? super E> fn) Subscribes given consumer to be executed after thisPromisecompletes exceptionally and an exception of thisPromiseis an instance of a given exceptionClass.AbstractPromise.whenResult(io.activej.common.function.ConsumerEx<? super T> fn) AbstractPromise.whenResult(io.activej.common.function.RunnableEx action) CompleteExceptionallyPromise.whenResult(io.activej.common.function.ConsumerEx<? super T> fn) CompleteExceptionallyPromise.whenResult(io.activej.common.function.RunnableEx action) CompletePromise.whenResult(io.activej.common.function.ConsumerEx<? super T> fn) CompletePromise.whenResult(io.activej.common.function.RunnableEx action) Promise.whenResult(io.activej.common.function.ConsumerEx<? super T> fn) Subscribes given consumer to be executed after thisPromisecompletes successfully.Promise.whenResult(io.activej.common.function.RunnableEx action) Subscribes given runnable to be executed after thisPromisecompletes successfully and a result of thisPromisesatisfy a givenPredicate.Methods in io.activej.promise that return types with arguments of type PromiseModifier and TypeMethodDescriptionPromises.asPromises(AsyncSupplier<? extends T>... tasks) Promises.asPromises(Iterable<? extends AsyncSupplier<? extends T>> tasks) Promises.asPromises(Iterator<? extends AsyncSupplier<? extends T>> tasks) Promises.asPromises(Stream<? extends AsyncSupplier<? extends T>> tasks) Methods in io.activej.promise with parameters of type PromiseModifier and TypeMethodDescriptionOptimized for 2 promises.static <T> Promise<T>static <T> Promise<T>static <T> Promise<T>Optimized for 2 promises.static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T> promise1) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T>... promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Promise<? extends T> promise1, Promise<? extends T> promise2) static <T> Tstatic <T> Voidstatic <T,E extends Exception>
ETestUtils.awaitException(Promise<T> promise) static <T,E extends Exception>
ETestUtils.awaitException(Promise<T>... promises) Returns a newPromisewhen both this and providedotherPromisescomplete.<U,V> Promise<V> AbstractPromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) <U,V> Promise<V> CompleteExceptionallyPromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) final <U,V> Promise<V> CompletePromise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? super T, ? super U, ? extends V> fn) <U,V> Promise<V> Promise.combine(Promise<? extends U> other, io.activej.common.function.BiFunctionEx<? 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> Promise<T>Delays completion of providedpromisefor the defined period of time.static <T> Promise<T>Promises.delay(ReactorScheduler reactor, long delayMillis, Promise<T> promise) static <T> Promise<T>Promises.delay(ReactorScheduler reactor, Duration delay, Promise<T> promise) static <T> Promise<T>Returns thePromisewhich was completed first.static <T> Promise<T>static <T> Promise<T>Promises.interval(ReactorScheduler reactor, long intervalMillis, Promise<T> promise) static <T> Promise<T>Promises.interval(ReactorScheduler reactor, Duration interval, Promise<T> promise) static <T> Promise<T>static <T,V> ResultWithPromise<T, V> static <T> Promise<T>Schedules completion of thePromiseso that it will be completed after the timestamp even if its operations were completed earlier.static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, long timestamp, Promise<T> promise) static <T> Promise<T>Promises.schedule(ReactorScheduler reactor, Instant instant, Promise<T> promise) static <T> Promise<T>static <T> Promise<T>Waits until the delay passes and if thePromiseis still not complete, tries to complete it withTIMEOUT_EXCEPTION.static <T> Promise<T>Promises.timeout(ReactorScheduler reactor, long delay, Promise<T> promise) static <T> Promise<T>Promises.timeout(ReactorScheduler reactor, Duration delay, Promise<T> promise) static <T> Promise<T>static <T> Promise<T[]>Returns an array withpromise1result.static <T> Promise<T[]>static <T> Promise<T[]>Returns an array withpromise1andpromise2results.Returns a completedPromisewith a result wrapped inList.ReturnsPromisewith a list ofpromise1andpromise2results.static <T1,R> Promise<R> Promises.toTuple(io.activej.common.tuple.TupleConstructor1<T1, R> constructor, Promise<? extends T1> promise1) static <T1,T2, R> Promise<R> Promises.toTuple(io.activej.common.tuple.TupleConstructor2<T1, T2, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2) static <T1,T2, T3, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor3<T1, T2, T3, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3) static <T1,T2, T3, T4, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor4<T1, T2, T3, T4, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4) static <T1,T2, T3, T4, T5, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor5<T1, T2, T3, T4, T5, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5) static <T1,T2, T3, T4, T5, T6, R>
Promise<R>Promises.toTuple(io.activej.common.tuple.TupleConstructor6<T1, T2, T3, T4, T5, T6, R> constructor, Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5, Promise<? extends T6> promise6) static <T1> Promise<io.activej.common.tuple.Tuple1<T1>>static <T1,T2> Promise<io.activej.common.tuple.Tuple2<T1, T2>> static <T1,T2, T3> Promise<io.activej.common.tuple.Tuple3<T1, T2, T3>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3) static <T1,T2, T3, T4>
Promise<io.activej.common.tuple.Tuple4<T1,T2, T3, T4>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4) static <T1,T2, T3, T4, T5>
Promise<io.activej.common.tuple.Tuple5<T1,T2, T3, T4, T5>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5) static <T1,T2, T3, T4, T5, T6>
Promise<io.activej.common.tuple.Tuple6<T1,T2, T3, T4, T5, T6>> Promises.toTuple(Promise<? extends T1> promise1, Promise<? extends T2> promise2, Promise<? extends T3> promise3, Promise<? extends T4> promise4, Promise<? extends T5> promise5, Promise<? extends T6> promise6) Method parameters in io.activej.promise with type arguments of type PromiseModifier and TypeMethodDescriptionReturnsPromisethat completes when all of thepromisesare completed.Returns aPromisethat completes when all of thepromisesare completed.static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Iterator<? extends Promise<? extends T>> promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, List<? extends Promise<? extends T>> promises) static <T> Promise<T>Promises.any(BiPredicate<? super T, Exception> predicate, Stream<? extends Promise<? extends T>> promises) static <T> Promise<T>static <T> Promise<T>static <T> Promise<T>static <T> Promise<T>Promises.first(BiPredicate<? super T, ? super Exception> predicate, Iterator<? extends Promise<? extends T>> promises) static <T> Promise<T>static <T> Promise<T>Promises.loop(T seed, Predicate<T> loopCondition, io.activej.common.function.FunctionEx<T, Promise<T>> next) Repeats providedFunctionExuntil can passPredicatetest.static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, int maxCalls, Iterator<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Collection<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Iterator<Promise<T>> promises) static <T,A, R> Promise<R> Promises.reduce(A accumulator, io.activej.common.function.BiConsumerEx<A, T> combiner, io.activej.common.function.FunctionEx<A, R> finisher, Stream<Promise<T>> promises) static <T,A, R> Promise<R> Calls everyPromisefrompromisesin sequence and discards their results.Returns aSettablePromisewithnullresult as a marker when all of thepromisesare completed.static <T> Promise<T[]>static <T> Promise<T[]>static <T> Promise<T[]>Reduces promises into Promise<Array>static <T> Promise<T[]>Reduces list ofPromises into Promise<List>.static <T> Promise<T>Promises.until(T seed, io.activej.common.function.FunctionEx<T, Promise<T>> next, Predicate<T> breakCondition) -
Uses of Promise in io.activej.promise.jmx
Methods in io.activej.promise.jmx that return PromiseMethods in io.activej.promise.jmx with parameters of type Promise