Package software.amazon.awssdk.crt.http
Class Http1StreamManager
- java.lang.Object
-
- software.amazon.awssdk.crt.http.Http1StreamManager
-
- All Implemented Interfaces:
AutoCloseable
public class Http1StreamManager extends Object implements AutoCloseable
Manages a Pool of HTTP/1.1 Streams. Creates and manages HTTP/1.1 connections under the hood. Will grab a connection from HttpClientConnectionManager to make request on it, and will return it back until the request finishes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<HttpStream>acquireStream(HttpRequestBase request, HttpStreamBaseResponseHandler streamHandler)Request an HTTP/1.1 HttpStream from StreamManager.CompletableFuture<HttpStream>acquireStream(HttpRequest request, HttpStreamBaseResponseHandler streamHandler)Request an HTTP/1.1 HttpStream from StreamManager.voidclose()static Http1StreamManagercreate(HttpClientConnectionManagerOptions options)Factory function for Http1StreamManager instancesHttpManagerMetricsgetManagerMetrics()intgetMaxConnections()CompletableFuture<Void>getShutdownCompleteFuture()
-
-
-
Method Detail
-
create
public static Http1StreamManager create(HttpClientConnectionManagerOptions options)
Factory function for Http1StreamManager instances- Parameters:
options- the connection manager options configure to connection manager under the hood- Returns:
- a new instance of an Http1StreamManager
-
getShutdownCompleteFuture
public CompletableFuture<Void> getShutdownCompleteFuture()
-
acquireStream
public CompletableFuture<HttpStream> acquireStream(HttpRequest request, HttpStreamBaseResponseHandler streamHandler)
Request an HTTP/1.1 HttpStream from StreamManager.- Parameters:
request- HttpRequest. The Request to make to the Server.streamHandler- HttpStreamBaseResponseHandler. The Stream Handler to be called from the Native EventLoop- Returns:
- A future for a HttpStream that will be completed when the stream is acquired.
- Throws:
CrtRuntimeException- Exception happens from acquiring stream.
-
acquireStream
public CompletableFuture<HttpStream> acquireStream(HttpRequestBase request, HttpStreamBaseResponseHandler streamHandler)
Request an HTTP/1.1 HttpStream from StreamManager.- Parameters:
request- HttpRequestBase. The Request to make to the Server.streamHandler- HttpStreamBaseResponseHandler. The Stream Handler to be called from the Native EventLoop- Returns:
- A future for a HttpStream that will be completed when the stream is acquired.
- Throws:
CrtRuntimeException- Exception happens from acquiring stream.
-
getManagerMetrics
public HttpManagerMetrics getManagerMetrics()
- Returns:
- concurrency metrics for the current manager
-
getMaxConnections
public int getMaxConnections()
- Returns:
- maximum number of connections this manager will pool
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-