Package software.amazon.awssdk.http.crt
Class AwsCrtAsyncHttpClient
java.lang.Object
software.amazon.awssdk.http.crt.AwsCrtAsyncHttpClient
- All Implemented Interfaces:
AutoCloseable
,SdkAsyncHttpClient
,SdkAutoCloseable
An implementation of
SdkAsyncHttpClient
that uses the AWS Common Runtime (CRT) Http Client to communicate with
Http Web Services. This client is asynchronous and uses non-blocking IO.
This can be created via builder()
SdkAsyncHttpClient client = AwsCrtAsyncHttpClient.builder()
.maxConcurrency(100)
.connectionTimeout(Duration.ofSeconds(1))
.connectionMaxIdleTime(Duration.ofSeconds(5))
.build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Builder that allows configuration of the AWS CRT HTTP implementation. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Each HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request.void
close()
static SdkAsyncHttpClient
create()
Create aAwsCrtAsyncHttpClient
client with the default configurationexecute
(AsyncExecuteRequest asyncRequest) Execute the request.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.utils.SdkAutoCloseable
close
-
Method Details
-
builder
-
create
Create aAwsCrtAsyncHttpClient
client with the default configuration- Returns:
- an
SdkAsyncHttpClient
-
clientName
Description copied from interface:SdkAsyncHttpClient
Each HTTP client implementation should return a well-formed client name that allows requests to be identifiable back to the client that made the request. The client name should include the backing implementation as well as the Sync or Async to identify the transmission type of the request. Client names should only include alphanumeric characters. Examples of well formed client names include, Apache, for requests using Apache's http client or NettyNio for Netty's http client.- Specified by:
clientName
in interfaceSdkAsyncHttpClient
- Returns:
- String containing the name of the client
-
execute
Description copied from interface:SdkAsyncHttpClient
Execute the request.- Specified by:
execute
in interfaceSdkAsyncHttpClient
- Parameters:
asyncRequest
- The request object.- Returns:
- The future holding the result of the request execution. Upon success execution of the request, the future is
completed with
null
, otherwise it is completed exceptionally.
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-