Skip to content

Commit

Permalink
Merge #2314 into netty5
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Jun 23, 2022
2 parents f808fa2 + c348d70 commit 337d864
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reactor-netty-core/build.gradle
Expand Up @@ -207,6 +207,8 @@ task japicmp(type: JapicmpTask) {
'reactor.netty.NettyPipeline#UnvoidHandler'
]
methodExcludes = [
"reactor.netty.resources.ConnectionProvider#create(java.lang.String, int, boolean)", // new static method in 1.0.21

'reactor.netty.NettyInbound#receive()',
'reactor.netty.NettyOutbound#alloc()',
'reactor.netty.NettyOutbound#send(org.reactivestreams.Publisher, java.util.function.Predicate)',
Expand Down
Expand Up @@ -161,6 +161,29 @@ static ConnectionProvider create(String name, int maxConnections) {
.build();
}

/**
* Create a new {@link ConnectionProvider} to cache and reuse a fixed maximum
* number of {@link Connection}.
* <p>A Fixed {@link ConnectionProvider} will open up to the given max connection value.
* Further connections will be pending acquisition until {@link #DEFAULT_POOL_ACQUIRE_TIMEOUT}
* and the default pending acquisition max count will be 2 * max connections value.
*
* @param name the connection pool name
* @param maxConnections the maximum number of connections before starting pending
* acquisition on existing ones
* @param metricsEnabled true enables metrics collection; false disables it
*
* @return a new {@link ConnectionProvider} to cache and reuse a fixed maximum
* number of {@link Connection}
* @since 1.0.21
*/
static ConnectionProvider create(String name, int maxConnections, boolean metricsEnabled) {
return builder(name).maxConnections(maxConnections)
.pendingAcquireTimeout(Duration.ofMillis(DEFAULT_POOL_ACQUIRE_TIMEOUT))
.metrics(metricsEnabled)
.build();
}

/**
* Return an existing or new {@link Connection} on subscribe.
*
Expand Down

0 comments on commit 337d864

Please sign in to comment.