Package 

Class TaskCompletionSource

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final Task<TResult> task
    • 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
      boolean trySetCancelled() Sets the cancelled flag 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.
      void setCancelled() Sets the cancelled flag on 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.
      void setError(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()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.