Class ITHttpAsyncClient<C>

java.lang.Object
brave.test.ITRemote
brave.test.http.ITHttpClient<C>
brave.test.http.ITHttpAsyncClient<C>

public abstract class ITHttpAsyncClient<C>
extends ITHttpClient<C>
  • Constructor Details

  • Method Details

    • get

      protected abstract void get​(C client, String path, BiConsumer<Integer,​Throwable> callback)
      This invokes a GET with the indicated path, but does not block until the response is complete.

      The success callback should always be invoked with the HTTP status code. If the implementation coerces a 500 code without an exception as an error, you should call the success callback directly.

      Invoke the callback with one of success or failure even in unexpected scenarios. For example, if there is a cancelation that didn't result in an error, invoke BiConsumer.accept(Object, Object) with your own CancellationException.

      Parameters:
      callback - accepts the status code or the error invoking the request
    • usesParentFromInvocationTime

      public void usesParentFromInvocationTime()
      This tests that the parent is determined at the time the request was made, not when the request was executed.
    • callbackContextIsFromInvocationTime

      public void callbackContextIsFromInvocationTime()
      This ensures that response callbacks run in the invocation context, not the client one. This allows async chaining to appear caused by the parent, not by the most recent client. Otherwise, we would see a client span child of a client span, which could be confused with duplicate instrumentation and affect dependency link counts.
    • callbackContextIsFromInvocationTime_root

      public void callbackContextIsFromInvocationTime_root()
      This ensures that response callbacks run when there is no invocation trace context.
    • addsStatusCodeWhenNotOk_async

      public void addsStatusCodeWhenNotOk_async()