Skip to content

Commit

Permalink
WebClient: add a creation method with pool options
Browse files Browse the repository at this point in the history
Pooling options used to be included in WebClientOptions/HttpClientOptions, but they are now separate.

Signed-off-by: Thomas Segismont <[email protected]>
  • Loading branch information
tsegismont committed Feb 1, 2024
1 parent b469772 commit f0037f8
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.PoolOptions;
import io.vertx.core.http.RequestOptions;
import io.vertx.core.http.impl.HttpClientInternal;
import io.vertx.core.net.SocketAddress;
Expand Down Expand Up @@ -58,7 +59,7 @@ static WebClient create(Vertx vertx) {
}

/**
* Create a web client using the provided {@code vertx} instance.
* Create a web client using the provided {@code vertx} instance and default pooling options.
*
* @param vertx the vertx instance
* @param options the Web Client options
Expand All @@ -68,6 +69,18 @@ static WebClient create(Vertx vertx, WebClientOptions options) {
return new WebClientBase(vertx.createHttpClient(options), options);
}

/**
* Create a web client using the provided {@code vertx} instance.
*
* @param vertx the vertx instance
* @param options the Web Client options
* @param poolOptions the HTTP Client pool options
* @return the created web client
*/
static WebClient create(Vertx vertx, WebClientOptions options, PoolOptions poolOptions) {
return new WebClientBase(vertx.createHttpClient(options, poolOptions), options);
}

/**
* Wrap an {@code httpClient} with a web client and default options.
*
Expand Down

0 comments on commit f0037f8

Please sign in to comment.