-
public class TaskCompletionSource<TResult>Copyright 2017 Meniga Iceland Inc.
-
-
Constructor Summary
Constructors Constructor Description TaskCompletionSource()Creates a TaskCompletionSource that orchestrates a Task. TaskCompletionSource(Call<TResult> callIn)Creates a TaskCompletionSource that orchestrates a Task.
-
Method Summary
Modifier and Type Method Description booleantrySetCancelled()Sets the cancelled flag on the Task if the Task hasn't already been completed. booleantrySetResult(TResult result)Sets the result on the Task if the Task hasn't already been completed. voidsetCancelled()Sets the cancelled flag on the task, throwing if the Task has already been completed. voidsetResult(TResult result)Sets the result of the Task, throwing if the Task has already been completed. voidsetError(Exception error)Sets the error of the Task, throwing if the Task has already been completed. <E> Task<E>createTask(Call<E> call)Task<TResult>getTask()-
-
Constructor Detail
-
TaskCompletionSource
TaskCompletionSource()
Creates a TaskCompletionSource that orchestrates a Task.
-
TaskCompletionSource
TaskCompletionSource(Call<TResult> callIn)
Creates a TaskCompletionSource that orchestrates a Task.
-
-
Method Detail
-
trySetCancelled
boolean trySetCancelled()
Sets the cancelled flag on the Task if the Task hasn't already been completed.
-
trySetResult
boolean trySetResult(TResult result)
Sets the result on the Task if the Task hasn't already been completed.
-
setCancelled
void setCancelled()
Sets the cancelled flag on the task, throwing if the Task has already been completed.
-
setResult
void setResult(TResult result)
Sets the result of the Task, throwing if the Task has already been completed.
-
setError
void setError(Exception error)
Sets the error of the Task, throwing if the Task has already been completed.
-
createTask
<E> Task<E> createTask(Call<E> call)
-
-
-
-