Class HttpClient.HttpClientImpl
- All Implemented Interfaces:
MutinyDelegate,HttpClient
- Enclosing interface:
- HttpClient
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vertx.mutiny.core.http.HttpClient
HttpClient.HttpClientImpl -
Constructor Summary
ConstructorsConstructorDescriptionHttpClientImpl(io.vertx.core.http.HttpClient delegate) Create a new instance ofHttpClient.HttpClientImpldelegating to the given (non-null) instance ofHttpClient. -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>close()Close immediately (shutdown(0, TimeUnit.SECONDS).voidClose immediately (shutdown(0, TimeUnit.SECONDS).Close immediately (shutdown(0, TimeUnit.SECONDS).io.vertx.core.http.HttpClientGet the delegate instance.io.smallrye.mutiny.Uni<HttpClientRequest>request()Create an HTTP request to send to the server with the default host and port of the client.io.smallrye.mutiny.Uni<HttpClientRequest>Create an HTTP request to send to the server at thehostandport.io.smallrye.mutiny.Uni<HttpClientRequest>Create an HTTP request to send to the server at the default host and port.io.smallrye.mutiny.Uni<HttpClientRequest>Create an HTTP request to send to the server at thehostand default port.io.smallrye.mutiny.Uni<HttpClientRequest>request(io.vertx.core.http.RequestOptions options) Create an HTTP request to send to the server.Create an HTTP request to send to the server with the default host and port of the client.requestAndAwait(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI) Create an HTTP request to send to the server at thehostandport.requestAndAwait(io.vertx.core.http.HttpMethod method, String requestURI) Create an HTTP request to send to the server at the default host and port.requestAndAwait(io.vertx.core.http.HttpMethod method, String host, String requestURI) Create an HTTP request to send to the server at thehostand default port.requestAndAwait(io.vertx.core.http.RequestOptions options) Create an HTTP request to send to the server.Create an HTTP request to send to the server with the default host and port of the client.requestAndForget(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI) Create an HTTP request to send to the server at thehostandport.requestAndForget(io.vertx.core.http.HttpMethod method, String requestURI) Create an HTTP request to send to the server at the default host and port.requestAndForget(io.vertx.core.http.HttpMethod method, String host, String requestURI) Create an HTTP request to send to the server at thehostand default port.requestAndForget(io.vertx.core.http.RequestOptions options) Create an HTTP request to send to the server.io.smallrye.mutiny.Uni<Void>shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).io.smallrye.mutiny.Uni<Void>Callsshutdown(Duration).io.smallrye.mutiny.Uni<Void>Initiate the client shutdown sequence.voidShutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).voidshutdownAndAwait(long timeout, TimeUnit unit) Callsshutdown(Duration).voidshutdownAndAwait(Duration timeout) Initiate the client shutdown sequence.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).shutdownAndForget(long timeout, TimeUnit unit) Callsshutdown(Duration).shutdownAndForget(Duration timeout) Initiate the client shutdown sequence.
-
Constructor Details
-
HttpClientImpl
public HttpClientImpl(io.vertx.core.http.HttpClient delegate) Create a new instance ofHttpClient.HttpClientImpldelegating to the given (non-null) instance ofHttpClient.
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpClient getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceHttpClient- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
request
Create an HTTP request to send to the server with the default host and port of the client.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
requestin interfaceHttpClient- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.request()
-
requestAndAwait
Create an HTTP request to send to the server with the default host and port of the client.Unlike the bare Vert.x variant, this method returns a
HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Returns:
- The operation result
- See Also:
-
HttpClient.request()
-
requestAndForget
Create an HTTP request to send to the server with the default host and port of the client.Unlike the bare Vert.x variant, this method ignores the
HttpClientRequestresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.request()
-
request
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.RequestOptions options) Create an HTTP request to send to the server.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
requestin interfaceHttpClient- Parameters:
options- the request options- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.request(RequestOptions)
-
requestAndAwait
Create an HTTP request to send to the server.Unlike the bare Vert.x variant, this method returns a
HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
options- the request options- Returns:
- The operation result
- See Also:
-
HttpClient.request(RequestOptions)
-
requestAndForget
Create an HTTP request to send to the server.Unlike the bare Vert.x variant, this method ignores the
HttpClientRequestresult or any failure.- Parameters:
options- the request options- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.request(RequestOptions)
-
request
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI) Create an HTTP request to send to the server at thehostandport.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
requestin interfaceHttpClient- Parameters:
method- the HTTP methodport- the porthost- the hostrequestURI- the relative URI- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.request(HttpMethod, int, String, String)
-
requestAndAwait
public HttpClientRequest requestAndAwait(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI) Create an HTTP request to send to the server at thehostandport.Unlike the bare Vert.x variant, this method returns a
HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
method- the HTTP methodport- the porthost- the hostrequestURI- the relative URI- Returns:
- The operation result
- See Also:
-
HttpClient.request(HttpMethod, int, String, String)
-
requestAndForget
public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, int port, String host, String requestURI) Create an HTTP request to send to the server at thehostandport.Unlike the bare Vert.x variant, this method ignores the
HttpClientRequestresult or any failure.- Parameters:
method- the HTTP methodport- the porthost- the hostrequestURI- the relative URI- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.request(HttpMethod, int, String, String)
-
request
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, String host, String requestURI) Create an HTTP request to send to the server at thehostand default port.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
requestin interfaceHttpClient- Parameters:
method- the HTTP methodhost- the hostrequestURI- the relative URI- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.request(HttpMethod, String, String)
-
requestAndAwait
public HttpClientRequest requestAndAwait(io.vertx.core.http.HttpMethod method, String host, String requestURI) Create an HTTP request to send to the server at thehostand default port.Unlike the bare Vert.x variant, this method returns a
HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
method- the HTTP methodhost- the hostrequestURI- the relative URI- Returns:
- The operation result
- See Also:
-
HttpClient.request(HttpMethod, String, String)
-
requestAndForget
public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, String host, String requestURI) Create an HTTP request to send to the server at thehostand default port.Unlike the bare Vert.x variant, this method ignores the
HttpClientRequestresult or any failure.- Parameters:
method- the HTTP methodhost- the hostrequestURI- the relative URI- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.request(HttpMethod, String, String)
-
request
@CheckReturnValue public io.smallrye.mutiny.Uni<HttpClientRequest> request(io.vertx.core.http.HttpMethod method, String requestURI) Create an HTTP request to send to the server at the default host and port.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
requestin interfaceHttpClient- Parameters:
method- the HTTP methodrequestURI- the relative URI- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.request(HttpMethod, String)
-
requestAndAwait
Create an HTTP request to send to the server at the default host and port.Unlike the bare Vert.x variant, this method returns a
HttpClientRequest. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
method- the HTTP methodrequestURI- the relative URI- Returns:
- The operation result
- See Also:
-
HttpClient.request(HttpMethod, String)
-
requestAndForget
public HttpClient.HttpClientImpl requestAndForget(io.vertx.core.http.HttpMethod method, String requestURI) Create an HTTP request to send to the server at the default host and port.Unlike the bare Vert.x variant, this method ignores the
HttpClientRequestresult or any failure.- Parameters:
method- the HTTP methodrequestURI- the relative URI- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.request(HttpMethod, String)
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
shutdownin interfaceHttpClient- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.shutdown()
-
shutdownAndAwait
public void shutdownAndAwait()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpClient.shutdown()
-
shutdownAndForget
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.shutdown()
-
close
Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
closein interfaceHttpClient- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.close()
-
closeAndAwait
public void closeAndAwait()Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpClient.close()
-
closeAndForget
Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.close()
-
shutdown
Callsshutdown(Duration).Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
shutdownin interfaceHttpClient- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.shutdown(long, TimeUnit)
-
shutdownAndAwait
Callsshutdown(Duration).Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpClient.shutdown(long, TimeUnit)
-
shutdownAndForget
Callsshutdown(Duration).Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.shutdown(long, TimeUnit)
-
shutdown
Initiate the client shutdown sequence.Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the
timeoutexpires, all unclosed connections are immediately closed.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
- HTTP/1.x client connection will be closed after the current response is received
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Specified by:
shutdownin interfaceHttpClient- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpClient.shutdown(Duration)
-
shutdownAndAwait
Initiate the client shutdown sequence.Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the
timeoutexpires, all unclosed connections are immediately closed.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
- HTTP/1.x client connection will be closed after the current response is received
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
timeout- the amount of time after which all resources are forcibly closed- See Also:
-
HttpClient.shutdown(Duration)
-
shutdownAndForget
Initiate the client shutdown sequence.Connections are taken out of service and closed when all inflight requests are processed, client connection are immediately removed from the pool. When all connections are closed the client is closed. When the
timeoutexpires, all unclosed connections are immediately closed.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close
- HTTP/1.x client connection will be closed after the current response is received
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpClient.shutdown(Duration)
-