Package | Description |
---|---|
javaslang.concurrent |
This package contains basic building blocks creating fast, asynchronous, non-blocking parallel code.
|
Modifier and Type | Method and Description |
---|---|
default Promise<T> |
Promise.complete(Try<? extends T> value)
Completes this
Promise with the given value . |
default Promise<T> |
Promise.completeWith(Future<? extends T> other)
Completes this
Promise with the given Future , once that Future is completed. |
static <T> Promise<T> |
Promise.failed(ExecutorService executorService,
Throwable exception)
Creates a failed
Promise , backed by the given ExecutorService . |
static <T> Promise<T> |
Promise.failed(Throwable exception)
Creates a failed
Promise , backed by the Future.DEFAULT_EXECUTOR_SERVICE . |
default Promise<T> |
Promise.failure(Throwable exception)
Completes this
Promise with the given exception . |
static <T> Promise<T> |
Promise.fromTry(ExecutorService executorService,
Try<? extends T> result)
|
static <T> Promise<T> |
Promise.fromTry(Try<? extends T> result)
|
static <T> Promise<T> |
Promise.make()
Makes a
Promise that isn't fulfilled yet, backed by the Future.DEFAULT_EXECUTOR_SERVICE . |
static <T> Promise<T> |
Promise.make(ExecutorService executorService)
Makes a
Promise that isn't fulfilled yet, backed by the given ExecutorService . |
static <T> Promise<T> |
Promise.narrow(Promise<? extends T> promise)
Narrows a widened
Promise<? extends T> to Promise<T>
by performing a type-safe cast. |
default Promise<T> |
Promise.success(T value)
Completes this
Promise with the given value . |
static <T> Promise<T> |
Promise.successful(ExecutorService executorService,
T result)
Creates a succeeded
Promise , backed by the given ExecutorService . |
static <T> Promise<T> |
Promise.successful(T result)
Creates a succeeded
Promise , backed by the Future.DEFAULT_EXECUTOR_SERVICE . |
default Promise<T> |
Promise.tryCompleteWith(Future<? extends T> other)
Attempts to complete this
Promise with the specified Future , once that Future is completed. |
Modifier and Type | Method and Description |
---|---|
static <T> Promise<T> |
Promise.narrow(Promise<? extends T> promise)
Narrows a widened
Promise<? extends T> to Promise<T>
by performing a type-safe cast. |
Copyright © 2016. All Rights Reserved.