Package software.amazon.awssdk.crt.http
Class Http1StreamManager
java.lang.Object
software.amazon.awssdk.crt.http.Http1StreamManager
- All Implemented Interfaces:
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
Modifier and TypeMethodDescriptionacquireStream(HttpRequestBase request, HttpStreamBaseResponseHandler streamHandler) Request an HTTP/1.1 HttpStream from StreamManager.acquireStream(HttpRequest request, HttpStreamBaseResponseHandler streamHandler) Request an HTTP/1.1 HttpStream from StreamManager.voidclose()static Http1StreamManagercreate(HttpClientConnectionManagerOptions options) Factory function for Http1StreamManager instancesint
-
Method Details
-
create
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
-
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
- 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
-