public class Promise<T> extends Callback<T>
| Constructor and Description |
|---|
Promise() |
| Modifier and Type | Method and Description |
|---|---|
T |
await()
see await( long timeout )
|
T |
await(long timeout)
in contradiction to original kontraktor promise this is blocking as there are no "Actors" in the client :).
|
void |
complete(T result,
Object error)
to be called by code returning an result or error.
|
void |
receive(T result,
Object error)
to be called by code returning an result or error.
|
void |
reject(Object error)
shorthand for complete( null, error)
|
void |
resolve(T result)
shorthand for complete( result, null )
|
void |
then(Callback<T> callback) |
public void resolve(T result)
result - public void reject(Object error)
error - public void complete(T result, Object error)
result - error - public void receive(T result, Object error)
public T await()
public T await(long timeout)
Copyright © 2017. All rights reserved.