Uses of Interface
io.vavr.concurrent.Future
-
Packages that use Future Package Description io.vavr BesideAPI
the io.vavr package contains core types like (Checked)Functions and Tuples.io.vavr.concurrent This package contains basic building blocks for creating fast, asynchronous, non-blocking parallel code. -
-
Uses of Future in io.vavr
Fields in io.vavr declared as Future Modifier and Type Field Description private Future<T1>
API.For1Future. ts1
private Future<T1>
API.For2Future. ts1
private Future<T1>
API.For3Future. ts1
private Future<T1>
API.For4Future. ts1
private Future<T1>
API.For5Future. ts1
private Future<T1>
API.For6Future. ts1
private Future<T1>
API.For7Future. ts1
private Future<T1>
API.For8Future. ts1
private Future<T2>
API.For2Future. ts2
private Future<T2>
API.For3Future. ts2
private Future<T2>
API.For4Future. ts2
private Future<T2>
API.For5Future. ts2
private Future<T2>
API.For6Future. ts2
private Future<T2>
API.For7Future. ts2
private Future<T2>
API.For8Future. ts2
private Future<T3>
API.For3Future. ts3
private Future<T3>
API.For4Future. ts3
private Future<T3>
API.For5Future. ts3
private Future<T3>
API.For6Future. ts3
private Future<T3>
API.For7Future. ts3
private Future<T3>
API.For8Future. ts3
private Future<T4>
API.For4Future. ts4
private Future<T4>
API.For5Future. ts4
private Future<T4>
API.For6Future. ts4
private Future<T4>
API.For7Future. ts4
private Future<T4>
API.For8Future. ts4
private Future<T5>
API.For5Future. ts5
private Future<T5>
API.For6Future. ts5
private Future<T5>
API.For7Future. ts5
private Future<T5>
API.For8Future. ts5
private Future<T6>
API.For6Future. ts6
private Future<T6>
API.For7Future. ts6
private Future<T6>
API.For8Future. ts6
private Future<T7>
API.For7Future. ts7
private Future<T7>
API.For8Future. ts7
private Future<T8>
API.For8Future. ts8
Methods in io.vavr that return Future Modifier and Type Method Description static <T> Future<T>
API. Future(CheckedFunction0<? extends T> computation)
Alias forof(CheckedFunction0)
static <T> Future<T>
API. Future(java.util.concurrent.Executor executorService, CheckedFunction0<? extends T> computation)
Alias forof(Executor, CheckedFunction0)
static <T> Future<T>
API. Future(java.util.concurrent.Executor executorService, T result)
Alias forsuccessful(Executor, Object)
static <T> Future<T>
API. Future(T result)
Alias forsuccessful(Object)
Future<T1>
API.For1Future. yield()
A shortcut foryield(Function.identity())
.<R> Future<R>
API.For1Future. yield(java.util.function.Function<? super T1,? extends R> f)
Yields a result for elements of the cross product of the underlying Future.<R> Future<R>
API.For2Future. yield(java.util.function.BiFunction<? super T1,? super T2,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For3Future. yield(Function3<? super T1,? super T2,? super T3,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For4Future. yield(Function4<? super T1,? super T2,? super T3,? super T4,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For5Future. yield(Function5<? super T1,? super T2,? super T3,? super T4,? super T5,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For6Future. yield(Function6<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For7Future. yield(Function7<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.<R> Future<R>
API.For8Future. yield(Function8<? super T1,? super T2,? super T3,? super T4,? super T5,? super T6,? super T7,? super T8,? extends R> f)
Yields a result for elements of the cross product of the underlying Futures.Methods in io.vavr that return types with arguments of type Future Modifier and Type Method Description static <T,_1 extends Option<Try<T>>>
API.Match.Pattern1<Future<T>,_1>Patterns. $Future(API.Match.Pattern<_1,?> p1)
Methods in io.vavr with parameters of type Future Modifier and Type Method Description static <T1> API.For1Future<T1>
API. For(Future<T1> ts1)
Creates aFor
-comprehension of one Future.static <T1,T2>
API.For2Future<T1,T2>API. For(Future<T1> ts1, Future<T2> ts2)
Creates aFor
-comprehension of two Futures.static <T1,T2,T3>
API.For3Future<T1,T2,T3>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3)
Creates aFor
-comprehension of three Futures.static <T1,T2,T3,T4>
API.For4Future<T1,T2,T3,T4>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4)
Creates aFor
-comprehension of 4 Futures.static <T1,T2,T3,T4,T5>
API.For5Future<T1,T2,T3,T4,T5>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5)
Creates aFor
-comprehension of 5 Futures.static <T1,T2,T3,T4,T5,T6>
API.For6Future<T1,T2,T3,T4,T5,T6>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6)
Creates aFor
-comprehension of 6 Futures.static <T1,T2,T3,T4,T5,T6,T7>
API.For7Future<T1,T2,T3,T4,T5,T6,T7>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7)
Creates aFor
-comprehension of 7 Futures.static <T1,T2,T3,T4,T5,T6,T7,T8>
API.For8Future<T1,T2,T3,T4,T5,T6,T7,T8>API. For(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7, Future<T8> ts8)
Creates aFor
-comprehension of 8 Futures.(package private) static <T> Tuple1<Option<Try<T>>>
$. Future(Future<T> future)
Constructors in io.vavr with parameters of type Future Constructor Description For1Future(Future<T1> ts1)
For2Future(Future<T1> ts1, Future<T2> ts2)
For3Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3)
For4Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4)
For5Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5)
For6Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6)
For7Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7)
For8Future(Future<T1> ts1, Future<T2> ts2, Future<T3> ts3, Future<T4> ts4, Future<T5> ts5, Future<T6> ts6, Future<T7> ts7, Future<T8> ts8)
-
Uses of Future in io.vavr.concurrent
Classes in io.vavr.concurrent that implement Future Modifier and Type Class Description (package private) class
FutureImpl<T>
INTERNAL API - This class is subject to change.Methods in io.vavr.concurrent that return Future Modifier and Type Method Description default Future<T>
Future. andThen(java.util.function.Consumer<? super Try<T>> action)
Support for chaining of callbacks that are guaranteed to be executed in a specific order.Future<T>
Future. await()
Blocks the current Thread until this Future completed or returns immediately if this Future is already completed.Future<T>
Future. await(long timeout, java.util.concurrent.TimeUnit unit)
Blocks the current Thread until this Future completed or returns immediately if this Future is already completed.Future<T>
FutureImpl. await()
Future<T>
FutureImpl. await(long timeout, java.util.concurrent.TimeUnit unit)
default <R> Future<R>
Future. collect(PartialFunction<? super T,? extends R> partialFunction)
Collects value that is in the domain of the givenpartialFunction
by mapping the value to typeR
.default Future<java.lang.Throwable>
Future. failed()
A projection that inverses the result of this Future.static <T> Future<T>
Future. failed(java.lang.Throwable exception)
static <T> Future<T>
Future. failed(java.util.concurrent.Executor executor, java.lang.Throwable exception)
Creates a failedFuture
with the givenexception
, backed by the givenExecutor
.default Future<T>
Future. fallbackTo(Future<? extends T> that)
Returns a Future that returns the result of this Future, if it is a success.default Future<T>
Future. filter(java.util.function.Predicate<? super T> predicate)
Shortcut forfilterTry(predicate::test
.default Future<T>
Future. filterTry(CheckedPredicate<? super T> predicate)
Filters the result of thisFuture
by callingTry.filterTry(CheckedPredicate)
.static <T> Future<Option<T>>
Future. find(java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.static <T> Future<Option<T>>
Future. find(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.static <T> Future<T>
Future. firstCompletedOf(java.lang.Iterable<? extends Future<? extends T>> futures)
Returns a newFuture
that will contain the result of the first of the given futures that is completed, backed by theDEFAULT_EXECUTOR
.static <T> Future<T>
Future. firstCompletedOf(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures)
Returns a newFuture
that will contain the result of the first of the given futures that is completed, backed by the givenExecutor
.default <U> Future<U>
Future. flatMap(java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
default <U> Future<U>
Future. flatMapTry(CheckedFunction1<? super T,? extends Future<? extends U>> mapper)
static <T,U>
Future<U>Future. fold(java.lang.Iterable<? extends Future<? extends T>> futures, U zero, java.util.function.BiFunction<? super U,? super T,? extends U> f)
Returns a Future which contains the result of the fold of the given future values.static <T,U>
Future<U>Future. fold(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, U zero, java.util.function.BiFunction<? super U,? super T,? extends U> f)
Returns a Future which contains the result of the fold of the given future values.static <T> Future<T>
Future. fromCompletableFuture(java.util.concurrent.CompletableFuture<T> future)
static <T> Future<T>
Future. fromCompletableFuture(java.util.concurrent.Executor executor, java.util.concurrent.CompletableFuture<T> future)
Creates aFuture
with the givenCompletableFuture
, backed by givenExecutor
static <T> Future<T>
Future. fromJavaFuture(java.util.concurrent.Executor executor, java.util.concurrent.Future<T> future)
Creates aFuture
with the given java.util.concurrent.Future, backed by givenExecutor
static <T> Future<T>
Future. fromJavaFuture(java.util.concurrent.Future<T> future)
Creates aFuture
with the given java.util.concurrent.Future, backed by theDEFAULT_EXECUTOR
static <T> Future<T>
Future. fromTry(Try<? extends T> result)
static <T> Future<T>
Future. fromTry(java.util.concurrent.Executor executor, Try<? extends T> result)
Future<T>
Promise. future()
Returns the underlyingFuture
of thisPromise
.Future<T>
PromiseImpl. future()
default <U> Future<U>
Future. map(java.util.function.Function<? super T,? extends U> mapper)
default <U> Future<U>
Future. mapTry(CheckedFunction1<? super T,? extends U> mapper)
static <T> Future<T>
Future. narrow(Future<? extends T> future)
Narrows a widenedFuture<? extends T>
toFuture<T>
by performing a type-safe cast.static <T> Future<T>
Future. of(CheckedFunction0<? extends T> computation)
Starts an asynchronous computation, backed by theDEFAULT_EXECUTOR
.static <T> Future<T>
Future. of(java.util.concurrent.Executor executor, CheckedFunction0<? extends T> computation)
Starts an asynchronous computation, backed by the givenExecutor
.static <T> Future<T>
Future. ofCallable(java.util.concurrent.Callable<? extends T> computation)
Deprecated.Will be removed.static <T> Future<T>
Future. ofCallable(java.util.concurrent.Executor executor, java.util.concurrent.Callable<? extends T> computation)
Deprecated.Will be removed.static <T> Future<T>
Future. ofSupplier(java.util.concurrent.Executor executor, java.util.function.Supplier<? extends T> computation)
Deprecated.Will be removed.static <T> Future<T>
Future. ofSupplier(java.util.function.Supplier<? extends T> computation)
Deprecated.Will be removed.Future<T>
Future. onComplete(java.util.function.Consumer<? super Try<T>> action)
Performs the action once the Future is complete.Future<T>
FutureImpl. onComplete(java.util.function.Consumer<? super Try<T>> action)
default Future<T>
Future. onFailure(java.util.function.Consumer<? super java.lang.Throwable> action)
Performs the action once the Future is complete and the result is aTry.Failure
.default Future<T>
Future. onSuccess(java.util.function.Consumer<? super T> action)
Performs the action once the Future is complete and the result is aTry.Success
.default Future<T>
Future. orElse(Future<? extends T> other)
default Future<T>
Future. orElse(java.util.function.Supplier<? extends Future<? extends T>> supplier)
default Future<T>
Future. peek(java.util.function.Consumer<? super T> action)
default Future<T>
Future. recover(java.util.function.Function<? super java.lang.Throwable,? extends T> f)
Handles a failure of this Future by returning another result.default Future<T>
Future. recoverWith(java.util.function.Function<? super java.lang.Throwable,? extends Future<? extends T>> f)
Handles a failure of this Future by returning the result of another Future.static <T> Future<T>
Future. reduce(java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.BiFunction<? super T,? super T,? extends T> f)
Returns a Future which contains the reduce result of the given future values.static <T> Future<T>
Future. reduce(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.BiFunction<? super T,? super T,? extends T> f)
Returns a Future which contains the reduce result of the given future values.static Future<java.lang.Void>
Future. run(CheckedRunnable unit)
Runs an asynchronous computation, backed by theDEFAULT_EXECUTOR
.static <T> Future<T>
Future. run(Task<? extends T> task)
Deprecated.Experimental APIstatic Future<java.lang.Void>
Future. run(java.util.concurrent.Executor executor, CheckedRunnable unit)
Starts an asynchronous computation, backed by the givenExecutor
.static <T> Future<T>
Future. run(java.util.concurrent.Executor executor, Task<? extends T> task)
Deprecated.Experimental APIstatic Future<java.lang.Void>
Future. runRunnable(java.lang.Runnable computation)
Deprecated.Will be removed.static Future<java.lang.Void>
Future. runRunnable(java.util.concurrent.Executor executor, java.lang.Runnable computation)
Deprecated.Will be removed.static <T> Future<Seq<T>>
Future. sequence(java.lang.Iterable<? extends Future<? extends T>> futures)
Reduces manyFuture
s into a singleFuture
by transforming anIterable<Future<? extends T>>
into aFuture<Seq<T>>
.static <T> Future<Seq<T>>
Future. sequence(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures)
Reduces manyFuture
s into a singleFuture
by transforming anIterable<Future<? extends T>>
into aFuture<Seq<T>>
.static <T> Future<T>
Future. successful(java.util.concurrent.Executor executor, T result)
Creates a succeededFuture
, backed by the givenExecutor
.static <T> Future<T>
Future. successful(T result)
Creates a succeededFuture
, backed by theDEFAULT_EXECUTOR
.default <U> Future<U>
Future. transformValue(java.util.function.Function<? super Try<T>,? extends Try<? extends U>> f)
Transforms the value of thisFuture
, whether it is a success or a failure.static <T,U>
Future<Seq<U>>Future. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
Maps the values of an iterable in parallel to a sequence of mapped values into a singleFuture
by transforming anIterable<? extends T>
into aFuture<Seq<U>>
.static <T,U>
Future<Seq<U>>Future. traverse(java.util.concurrent.Executor executor, java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
Maps the values of an iterable in parallel to a sequence of mapped values into a singleFuture
by transforming anIterable<? extends T>
into aFuture<Seq<U>>
.default <U> Future<Tuple2<T,U>>
Future. zip(Future<? extends U> that)
Returns a tuple of this and that Future result.default <U,R>
Future<R>Future. zipWith(Future<? extends U> that, java.util.function.BiFunction<? super T,? super U,? extends R> combinator)
Returns a this and that Future result combined using a given combinator function.Methods in io.vavr.concurrent with parameters of type Future Modifier and Type Method Description default Promise<T>
Promise. completeWith(Future<? extends T> other)
Completes thisPromise
with the givenFuture
, once thatFuture
is completed.default Future<T>
Future. fallbackTo(Future<? extends T> that)
Returns a Future that returns the result of this Future, if it is a success.static <T> Future<T>
Future. narrow(Future<? extends T> future)
Narrows a widenedFuture<? extends T>
toFuture<T>
by performing a type-safe cast.default Future<T>
Future. orElse(Future<? extends T> other)
default Promise<T>
Promise. tryCompleteWith(Future<? extends T> other)
Attempts to complete thisPromise
with the specifiedFuture
, once thatFuture
is completed.default <U> Future<Tuple2<T,U>>
Future. zip(Future<? extends U> that)
Returns a tuple of this and that Future result.default <U,R>
Future<R>Future. zipWith(Future<? extends U> that, java.util.function.BiFunction<? super T,? super U,? extends R> combinator)
Returns a this and that Future result combined using a given combinator function.Method parameters in io.vavr.concurrent with type arguments of type Future Modifier and Type Method Description static <T> Future<Option<T>>
Future. find(java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.static <T> Future<Option<T>>
Future. find(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.Predicate<? super T> predicate)
Returns aFuture
that eventually succeeds with the first result of the givenFuture
s which matches the givenpredicate
.static <T> Future<T>
Future. firstCompletedOf(java.lang.Iterable<? extends Future<? extends T>> futures)
Returns a newFuture
that will contain the result of the first of the given futures that is completed, backed by theDEFAULT_EXECUTOR
.static <T> Future<T>
Future. firstCompletedOf(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures)
Returns a newFuture
that will contain the result of the first of the given futures that is completed, backed by the givenExecutor
.default <U> Future<U>
Future. flatMap(java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
default <U> Future<U>
Future. flatMapTry(CheckedFunction1<? super T,? extends Future<? extends U>> mapper)
static <T,U>
Future<U>Future. fold(java.lang.Iterable<? extends Future<? extends T>> futures, U zero, java.util.function.BiFunction<? super U,? super T,? extends U> f)
Returns a Future which contains the result of the fold of the given future values.static <T,U>
Future<U>Future. fold(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, U zero, java.util.function.BiFunction<? super U,? super T,? extends U> f)
Returns a Future which contains the result of the fold of the given future values.default Future<T>
Future. orElse(java.util.function.Supplier<? extends Future<? extends T>> supplier)
default Future<T>
Future. recoverWith(java.util.function.Function<? super java.lang.Throwable,? extends Future<? extends T>> f)
Handles a failure of this Future by returning the result of another Future.static <T> Future<T>
Future. reduce(java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.BiFunction<? super T,? super T,? extends T> f)
Returns a Future which contains the reduce result of the given future values.static <T> Future<T>
Future. reduce(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures, java.util.function.BiFunction<? super T,? super T,? extends T> f)
Returns a Future which contains the reduce result of the given future values.static <T> Future<Seq<T>>
Future. sequence(java.lang.Iterable<? extends Future<? extends T>> futures)
Reduces manyFuture
s into a singleFuture
by transforming anIterable<Future<? extends T>>
into aFuture<Seq<T>>
.static <T> Future<Seq<T>>
Future. sequence(java.util.concurrent.Executor executor, java.lang.Iterable<? extends Future<? extends T>> futures)
Reduces manyFuture
s into a singleFuture
by transforming anIterable<Future<? extends T>>
into aFuture<Seq<T>>
.default <U> U
Future. transform(java.util.function.Function<? super Future<T>,? extends U> f)
Transforms thisFuture
.static <T,U>
Future<Seq<U>>Future. traverse(java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
Maps the values of an iterable in parallel to a sequence of mapped values into a singleFuture
by transforming anIterable<? extends T>
into aFuture<Seq<U>>
.static <T,U>
Future<Seq<U>>Future. traverse(java.util.concurrent.Executor executor, java.lang.Iterable<? extends T> values, java.util.function.Function<? super T,? extends Future<? extends U>> mapper)
Maps the values of an iterable in parallel to a sequence of mapped values into a singleFuture
by transforming anIterable<? extends T>
into aFuture<Seq<U>>
.
-