Interface Callback<V>

  • Type Parameters:
    V - the type of value returned by the call

    public interface Callback<V>
    Asynchronous Call listeners.
    Author:
    Fabio Simeoni
    See Also:
    Call
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void done​(V value)
      Invoked when the value returned by the call is available.
      void onFailure​(Throwable failure)
      Invoked when the call does not complete successfully.
      long timeout()
      The time to wait on the value returned by the call.
    • Method Detail

      • done

        void done​(V value)
        Invoked when the value returned by the call is available.
        Parameters:
        value - the value
      • onFailure

        void onFailure​(Throwable failure)
        Invoked when the call does not complete successfully.

        Failures may be generated by a Calls, or by the expiration of timeouts set on their asynchronous execution. In the latter case, the failures are TimeoutExceptions.

        Parameters:
        failure - the failure
      • timeout

        long timeout()
        The time to wait on the value returned by the call.
        Returns:
        the timeout