Interface EarlyHintsListener

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface EarlyHintsListener
    Callback interface for receiving 103 Early Hints informational responses emitted by the server before the final response.

    The listener may be invoked multiple times per request, once for each 103 received. It is never invoked for the final (non-1xx) response.

    Implementations should be fast and non-blocking. If heavy work is needed, offload it to an application executor.

    Since:
    5.6
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onEarlyHints​(org.apache.hc.core5.http.HttpResponse hints, org.apache.hc.core5.http.protocol.HttpContext context)
      Called for each received 103 Early Hints informational response.
    • Method Detail

      • onEarlyHints

        void onEarlyHints​(org.apache.hc.core5.http.HttpResponse hints,
                          org.apache.hc.core5.http.protocol.HttpContext context)
                   throws org.apache.hc.core5.http.HttpException,
                          java.io.IOException
        Called for each received 103 Early Hints informational response.
        Parameters:
        hints - the 103 response object as received on the wire
        context - the current execution context (never null)
        Throws:
        org.apache.hc.core5.http.HttpException - to signal an HTTP-layer error while handling hints
        java.io.IOException - to signal an I/O error while handling hints