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.Executorexecutor()java.util.concurrent.ExecutorServiceexecutorService()Deprecated.Future<T>future()Returns the underlyingFutureof thisPromise.java.lang.StringtoString()booleantryComplete(Try<? extends T> value)Attempts to completes thisPromisewith 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:PromiseThis method is deprecated.THE DEFAULT IMPLEMENTATION (obtained by one of the
Promisefactory methods) MIGHT THROW ANUnsupportedOperationExceptionAT RUNTIME, DEPENDING ON WHATFuture.executorService()returns.- Specified by:
executorServicein interfacePromise<T>- Returns:
- (never)
-
future
public Future<T> future()
Description copied from interface:PromiseReturns the underlyingFutureof thisPromise.
-
tryComplete
public boolean tryComplete(Try<? extends T> value)
Description copied from interface:PromiseAttempts to completes thisPromisewith the givenvalue.- Specified by:
tryCompletein interfacePromise<T>- Parameters:
value- Either aTry.Successcontaining the result or aTry.Failurecontaining an exception.- Returns:
falseif thisPromisehas already been completed,trueotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-