public class Task.TaskCompletionSource
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Task<TResult> |
getTask() |
void |
setCancelled()
Sets the cancelled flag on the task, throwing if the Task has already been completed.
|
void |
setError(java.lang.Exception error)
Sets the error of the Task, throwing if the Task has already been completed.
|
void |
setResult(TResult result)
Sets the result of the Task, throwing if the Task has already been completed.
|
boolean |
trySetCancelled()
Sets the cancelled flag on the Task if the Task hasn't already been completed.
|
boolean |
trySetError(java.lang.Exception error)
Sets the error on the Task if the Task hasn't already been completed.
|
boolean |
trySetResult(TResult result)
Sets the result on the Task if the Task hasn't already been completed.
|
public boolean trySetCancelled()
public boolean trySetResult(TResult result)
public boolean trySetError(java.lang.Exception error)
public void setCancelled()
public void setResult(TResult result)
public void setError(java.lang.Exception error)