Skip to content

Commit f0037f8

Browse files
committed
WebClient: add a creation method with pool options
Pooling options used to be included in WebClientOptions/HttpClientOptions, but they are now separate. Signed-off-by: Thomas Segismont <[email protected]>
1 parent b469772 commit f0037f8

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

vertx-web-client/src/main/java/io/vertx/ext/web/client/WebClient.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import io.vertx.core.buffer.Buffer;
2121
import io.vertx.core.http.HttpClient;
2222
import io.vertx.core.http.HttpMethod;
23+
import io.vertx.core.http.PoolOptions;
2324
import io.vertx.core.http.RequestOptions;
2425
import io.vertx.core.http.impl.HttpClientInternal;
2526
import io.vertx.core.net.SocketAddress;
@@ -58,7 +59,7 @@ static WebClient create(Vertx vertx) {
5859
}
5960

6061
/**
61-
* Create a web client using the provided {@code vertx} instance.
62+
* Create a web client using the provided {@code vertx} instance and default pooling options.
6263
*
6364
* @param vertx the vertx instance
6465
* @param options the Web Client options
@@ -68,6 +69,18 @@ static WebClient create(Vertx vertx, WebClientOptions options) {
6869
return new WebClientBase(vertx.createHttpClient(options), options);
6970
}
7071

72+
/**
73+
* Create a web client using the provided {@code vertx} instance.
74+
*
75+
* @param vertx the vertx instance
76+
* @param options the Web Client options
77+
* @param poolOptions the HTTP Client pool options
78+
* @return the created web client
79+
*/
80+
static WebClient create(Vertx vertx, WebClientOptions options, PoolOptions poolOptions) {
81+
return new WebClientBase(vertx.createHttpClient(options, poolOptions), options);
82+
}
83+
7184
/**
7285
* Wrap an {@code httpClient} with a web client and default options.
7386
*

0 commit comments

Comments
 (0)