public final class Promise extends Object
gololang.Async module.Future,
AssignedFuture| Constructor and Description |
|---|
Promise() |
| Modifier and Type | Method and Description |
|---|---|
Object |
blockingGet()
Blocking get, waiting until the promise is resolved.
|
Promise |
fail(Throwable throwable)
Fails the promise.
|
Future |
future()
Creates a new future to observe the eventual resolution of this promise.
|
Object |
get()
Non-blocking get.
|
boolean |
isFailed()
Checks whether the promise has failed.
|
boolean |
isResolved()
Checks whether the promise has been resolved.
|
Promise |
set(Object value)
Sets the promise value.
|
String |
toString() |
public boolean isResolved()
true if it has been resolved, false otherwise.public boolean isFailed()
true if it has been resolved and failed, false otherwise.public Object get()
null if it has not been resolved yet.public Object blockingGet() throws InterruptedException
InterruptedException - if the current thread gets interrupted.public Promise set(Object value)
value - the value.public Promise fail(Throwable throwable)
throwable - the failure.public Future future()
Copyright © 2014 Institut National des Sciences Appliquées de Lyon (INSA-Lyon). All Rights Reserved.