Top Description Fields Constructors Methods
io.vavr.concurrent

pack-priv final Class PromiseImpl<T>

Located in compilation unit of io.vavr.concurrent.Promise.

extends Object
implements Promise<T>
Class Inheritance
All Implemented Interfaces
io.vavr.concurrent.Promise
Type Parameters
<T>
result type

Internal Promise implementation.
Author
Daniel Dietrich

Field Summary

Modifier and TypeField and Description
private final FutureImpl<T>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Executor
executor()

Overrides default io.vavr.concurrent.Promise.executor.

Returns the Executor used by the underlying Future of this Promise.

public ExecutorService
executorService()

Implements io.vavr.concurrent.Promise.executorService.

Deprecated

This method is deprecated.

public Future<T>
future()

Implements io.vavr.concurrent.Promise.future.

Returns the underlying Future of this Promise.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

public boolean
tryComplete(Try<? extends T>
Either a Try.Success containing the result or a Try.Failure containing an exception.
value
)

Implements io.vavr.concurrent.Promise.tryComplete.

Attempts to completes this Promise with the given value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

futureback to summary
private final FutureImpl<T> future

Constructor Detail

PromiseImplback to summary
pack-priv PromiseImpl(FutureImpl<T> future)

Method Detail

executorback to summary
public Executor executor()

Overrides default io.vavr.concurrent.Promise.executor.

Doc from io.vavr.concurrent.Promise.executor.

Returns the Executor used by the underlying Future of this Promise.

Returns:Executor

The underlying Executor.

Annotations
@Override
executorServiceback to summary
public ExecutorService executorService()

Implements io.vavr.concurrent.Promise.executorService.

Doc from io.vavr.concurrent.Promise.executorService.

Deprecated

This method is deprecated.

THE DEFAULT IMPLEMENTATION (obtained by one of the Promise factory methods) MIGHT THROW AN UnsupportedOperationException AT RUNTIME, DEPENDING ON WHAT Future#executorService() returns.

Returns:ExecutorService

(never)

Annotations
@Deprecated
@Override
futureback to summary
public Future<T> future()

Implements io.vavr.concurrent.Promise.future.

Doc from io.vavr.concurrent.Promise.future.

Returns the underlying Future of this Promise.

Returns:Future<T>

The Future.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
tryCompleteback to summary
public boolean tryComplete(Try<? extends T> value)

Implements io.vavr.concurrent.Promise.tryComplete.

Doc from io.vavr.concurrent.Promise.tryComplete.

Attempts to completes this Promise with the given value.

Parameters
value:Try<? extends T>

Either a Try.Success containing the result or a Try.Failure containing an exception.

Returns:boolean

false if this Promise has already been completed, true otherwise.

Annotations
@Override