Interface Http2AllocationStrategy.Builder

Enclosing class:
Http2AllocationStrategy

public static interface Http2AllocationStrategy.Builder
  • Method Details

    • build

      Returns:
      a new Http2AllocationStrategy
    • maxConcurrentStreams

      Http2AllocationStrategy.Builder maxConcurrentStreams(long maxConcurrentStreams)
      Configures the maximum number of the concurrent streams that can be opened to the remote peer. When evaluating how many streams can be opened to the remote peer, the minimum of this configuration and the remote peer configuration is taken (unless -1 is used). Default to -1 - use always the remote peer configuration.
      Parameters:
      maxConcurrentStreams - the maximum number of the concurrent streams that can be opened to the remote peer
      Returns:
      this
    • maxConnections

      Http2AllocationStrategy.Builder maxConnections(int maxConnections)
      Configures the maximum number of live connections to keep in the pool. Default to Integer.MAX_VALUE - no upper limit.
      Parameters:
      maxConnections - the maximum number of live connections to keep in the pool
      Returns:
      this
    • minConnections

      Http2AllocationStrategy.Builder minConnections(int minConnections)
      Configures the minimum number of live connections to keep in the pool (can be the best effort). When configured with a value greater than zero, the pool will also enable strict connection reuse. Default to 0.
      Parameters:
      minConnections - the minimum number of live connections to keep in the pool
      Returns:
      this
      See Also:
    • strictConnectionReuse

      default Http2AllocationStrategy.Builder strictConnectionReuse(boolean strictConnectionReuse)
      Configures whether the HTTP/2 pool should avoid opening additional connections as long as existing connections have not reached their max concurrent streams limit. When enabled, the pool may operate with fewer connections (even a single one) and will only allocate a new connection when all existing connections have reached their max concurrent streams.

      This behavior is automatically enabled when minConnections(int) is configured with a value greater than zero. Use this option to enable the same behavior without setting a minimum connections constraint.

      Default to false.

      Parameters:
      strictConnectionReuse - whether strict connection reuse should be enabled
      Returns:
      this
      Since:
      1.3.3