#403, updated javadocs
This commit is contained in:
parent
ad11ea46b1
commit
59cf100302
@ -139,7 +139,7 @@ public class Promise<T> extends PromiseSupport<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A consume action provides the action, the value from source promise and fulfills the
|
* Accesses the value from source promise and calls the consumer, then fulfills the
|
||||||
* destination promise.
|
* destination promise.
|
||||||
*/
|
*/
|
||||||
private class ConsumeAction implements Runnable {
|
private class ConsumeAction implements Runnable {
|
||||||
@ -166,8 +166,8 @@ public class Promise<T> extends PromiseSupport<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function action provides transformation function, value from source promise and fulfills the
|
* Accesses the value from source promise, then fulfills the destination promise using the
|
||||||
* destination promise with the transformed value.
|
* transformed value. The source value is transformed using the transformation function.
|
||||||
*/
|
*/
|
||||||
private class TransformAction<V> implements Runnable {
|
private class TransformAction<V> implements Runnable {
|
||||||
|
|
||||||
@ -184,8 +184,7 @@ public class Promise<T> extends PromiseSupport<T> {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
V result = func.apply(src.get());
|
dest.fulfill(func.apply(src.get()));
|
||||||
dest.fulfill(result);
|
|
||||||
} catch (Throwable throwable) {
|
} catch (Throwable throwable) {
|
||||||
dest.fulfillExceptionally((Exception) throwable.getCause());
|
dest.fulfillExceptionally((Exception) throwable.getCause());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user