Package | Description |
---|---|
javascalautils.concurrent |
Contains utilities for concurrent/asynchronous programming.
|
Modifier and Type | Method and Description |
---|---|
static <T> Future<T> |
Future.apply(ThrowableFunction0<T> function)
Allows for easy creation of asynchronous computations that will be executed in the future.
|
static <T> Future<T> |
Future.apply(ThrowableFunction0<T> function,
Executor executor)
Allows for easy creation of asynchronous computations that will be executed in the future.
|
<T> Future<T> |
Executor.execute(Callable<T> callable)
Executes the provided
Callable sometime in the future. |
<T> Future<T> |
Executor.execute(Executable<T> executable)
Executes the provided
Executable sometime in the future. |
Future<T> |
Future.filter(java.util.function.Predicate<T> predicate)
Creates a new
Future that will filter the successful value of this instance once it is completed. |
<R> Future<R> |
Future.flatMap(java.util.function.Function<T,Future<R>> function)
Creates a new
Future that will hold the mapped successful value of this instance once it is completed. |
Future<T> |
Promise.future()
Get a
Future that will hold the value once this Promise is completed. |
static <T> Future<T> |
FutureCompanion.Future(ThrowableFunction0<T> function)
Allows for easy creation of asynchronous computations that will be executed in the future.
|
static <T> Future<T> |
FutureCompanion.Future(ThrowableFunction0<T> function,
Executor executor)
Allows for easy creation of asynchronous computations that will be executed in the future.
|
<R> Future<R> |
Future.map(java.util.function.Function<T,R> function)
Creates a new
Future that will hold the mapped successful value of this instance once it is completed. |
Future<T> |
Future.recover(java.util.function.Function<Throwable,T> recoverFunction)
|
<R> Future<R> |
Future.transform(java.util.function.Function<T,R> onSuccess,
java.util.function.Function<Throwable,Throwable> onFailure)
Creates a new
Future that will hold the transformed successful value of this instance once it is completed. |
Modifier and Type | Method and Description |
---|---|
<T> List<Future<T>> |
Executor.executeAll(Callable<T>... callables)
Executes the list of provided
Callable sometime in the future. |
<T> List<Future<T>> |
Executor.executeAll(Executable<T>... executables)
Executes the list of provided
Executable sometime in the future. |
Modifier and Type | Method and Description |
---|---|
void |
Promise.completeWith(Future<T> future)
|
boolean |
Promise.tryCompleteWith(Future<T> future)
|
Modifier and Type | Method and Description |
---|---|
<R> Future<R> |
Future.flatMap(java.util.function.Function<T,Future<R>> function)
Creates a new
Future that will hold the mapped successful value of this instance once it is completed. |
Copyright © 2015, Peter Nerg Apache License v2.0