Package reactor.netty.http.client
Interface Http2AllocationStrategy.Builder
- Enclosing class:
- Http2AllocationStrategy
public static interface Http2AllocationStrategy.Builder
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build a newHttp2AllocationStrategy.maxConcurrentStreams(long maxConcurrentStreams) Configures the maximum number of the concurrent streams that can be opened to the remote peer.maxConnections(int maxConnections) Configures the maximum number of live connections to keep in the pool.minConnections(int minConnections) Configures the minimum number of live connections to keep in the pool (can be the best effort).default Http2AllocationStrategy.BuilderstrictConnectionReuse(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.
-
Method Details
-
build
Http2AllocationStrategy build()Build a newHttp2AllocationStrategy.- Returns:
- a new
Http2AllocationStrategy
-
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
Configures the maximum number of live connections to keep in the pool. Default toInteger.MAX_VALUE- no upper limit.- Parameters:
maxConnections- the maximum number of live connections to keep in the pool- Returns:
this
-
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 enablestrict connection reuse. Default to0.- Parameters:
minConnections- the minimum number of live connections to keep in the pool- Returns:
this- See Also:
-
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
-