Class Http2StreamManager

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class Http2StreamManager
    extends CrtResource
    Manages a Pool of HTTP/2 Streams. Creates and manages HTTP/2 connections under the hood.
    • Method Detail

      • create

        public static Http2StreamManager create​(Http2StreamManagerOptions options)
        Factory function for Http2StreamManager instances
        Parameters:
        options - configuration options
        Returns:
        a new instance of an Http2StreamManager
      • acquireStream

        public java.util.concurrent.CompletableFuture<Http2Stream> acquireStream​(Http2Request request,
                                                                                 HttpStreamBaseResponseHandler streamHandler)
        Request a Http2Stream from StreamManager.
        Parameters:
        request - The Request to make to the Server.
        streamHandler - The Stream Handler to be called from the Native EventLoop
        Returns:
        A future for a Http2Stream that will be completed when the stream is acquired.
      • getMaxConnections

        public int getMaxConnections()
        Returns:
        maximum number of connections this connection manager will pool
      • getManagerMetrics

        public HttpManagerMetrics getManagerMetrics()
        Returns:
        concurrency metrics for the current manager
      • getShutdownCompleteFuture

        public java.util.concurrent.CompletableFuture<java.lang.Void> getShutdownCompleteFuture()