public static interface HttpClient.HttpConnection extends Closeable, AsyncCloseable
Connections should be closed when no longer needed to release resources.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection and releases any resources.
|
CompletableFuture<Void> |
closeAsync()
Asynchronously closes this connection and releases any resources.
|
HttpClient.Response |
execute(HttpClient.Request request)
Executes an HTTP request using this connection.
|
CompletableFuture<HttpClient.Response> |
executeAsync(HttpClient.Request request)
Asynchronously executes an HTTP request using this connection.
|
boolean |
isActive()
Checks if this connection is still active and can be used for requests.
|
HttpClient.Response execute(HttpClient.Request request) throws IOException
request - the HTTP request to execute, must not be null.IOException - if an I/O error occurs or the connection is closed.CompletableFuture<HttpClient.Response> executeAsync(HttpClient.Request request)
request - the HTTP request to execute, must not be null.CompletableFuture that will be completed with the HTTP response.boolean isActive()
true if the connection is active, false otherwise.void close()
close in interface AutoCloseableclose in interface CloseableCompletableFuture<Void> closeAsync()
closeAsync in interface AsyncCloseableCompletableFuture that will be completed when the connection is closed.Copyright © 2026 lettuce.io. All rights reserved.