Package io.vavr.concurrent
Class PromiseImpl<T>
- java.lang.Object
-
- io.vavr.concurrent.PromiseImpl<T>
-
-
Field Summary
Fields Modifier and Type Field Description private FutureImpl<T>
future
-
Constructor Summary
Constructors Constructor Description PromiseImpl(FutureImpl<T> future)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.concurrent.Executor
executor()
java.util.concurrent.ExecutorService
executorService()
Deprecated.Future<T>
future()
Returns the underlyingFuture
of thisPromise
.java.lang.String
toString()
boolean
tryComplete(Try<? extends T> value)
Attempts to completes thisPromise
with the givenvalue
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.vavr.concurrent.Promise
complete, completeWith, failure, isCompleted, success, tryCompleteWith, tryFailure, trySuccess
-
-
-
-
Field Detail
-
future
private final FutureImpl<T> future
-
-
Constructor Detail
-
PromiseImpl
PromiseImpl(FutureImpl<T> future)
-
-
Method Detail
-
executor
public java.util.concurrent.Executor executor()
Description copied from interface:Promise
-
executorService
@Deprecated public java.util.concurrent.ExecutorService executorService()
Deprecated.Description copied from interface:Promise
This method is deprecated.THE DEFAULT IMPLEMENTATION (obtained by one of the
Promise
factory methods) MIGHT THROW ANUnsupportedOperationException
AT RUNTIME, DEPENDING ON WHATFuture.executorService()
returns.- Specified by:
executorService
in interfacePromise<T>
- Returns:
- (never)
-
future
public Future<T> future()
Description copied from interface:Promise
Returns the underlyingFuture
of thisPromise
.
-
tryComplete
public boolean tryComplete(Try<? extends T> value)
Description copied from interface:Promise
Attempts to completes thisPromise
with the givenvalue
.- Specified by:
tryComplete
in interfacePromise<T>
- Parameters:
value
- Either aTry.Success
containing the result or aTry.Failure
containing an exception.- Returns:
false
if thisPromise
has already been completed,true
otherwise.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-