Interface HttpClientConnection

  • All Superinterfaces:
    HttpClient, HttpConnection

    @Unstable
    public interface HttpClientConnection
    extends HttpConnection, HttpClient
    Represents an HTTP client connection.

    You can use this connection to create requests to the connected server.

    Depending on the nature of the connection, requests might just be sent to the server or might be queued until a connection request is available.

    Author:
    Julien Viet
    • Method Detail

      • activeStreams

        long activeStreams()
        Returns:
        the number of active request/response (streams)
      • maxActiveStreams

        long maxActiveStreams()
        Returns:
        the max number of concurrent active streams this connection can handle
      • shutdown

        default Future<Void> shutdown()
        Description copied from interface: HttpConnection
        Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).
        Specified by:
        shutdown in interface HttpClient
        Specified by:
        shutdown in interface HttpConnection
        Returns:
        a future completed when shutdown has completed
      • shutdown

        Future<Void> shutdown​(long timeout,
                              TimeUnit unit)
        Description copied from interface: HttpConnection
        Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after a timeout the connection will be closed. Client connection are immediately removed from the pool.
        • HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
        • HTTP/1.x connection will be closed.
        Specified by:
        shutdown in interface HttpClient
        Specified by:
        shutdown in interface HttpConnection
        Parameters:
        timeout - the amount of time after which all resources are forcibly closed
        unit - the of the timeout
        Returns:
        a future completed when shutdown has completed