Package zipkin2

Interface Callback<V>


public interface Callback<V>
A callback of a single result or error.

This is a bridge to async libraries such as CompletableFuture complete, completeExceptionally.

Implementations will call either onSuccess(V) or onError(java.lang.Throwable), but not both.

  • Method Summary

    Modifier and Type Method Description
    void onError​(Throwable t)
    Invoked when computation produces a possibly null value successfully.
    void onSuccess​(V value)
    Invoked when computation produces its potentially null value successfully.
  • Method Details

    • onSuccess

      void onSuccess​(@Nullable V value)
      Invoked when computation produces its potentially null value successfully.

      When this is called, onError(java.lang.Throwable) won't be.

    • onError

      void onError​(Throwable t)
      Invoked when computation produces a possibly null value successfully.

      When this is called, onSuccess(V) won't be.