What is the purpose of asyncConfiguration SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR
?
in which use cases should we use it?
from java doc on FUTURE_COMPLETION_EXECUTOR
, I see: Configure the executor that should be used to complete the CompletableFuture that is returned by the service clients.
I thought that subsequent calls on CompletableFuture
of async result will be executed on executor passed in FUTURE_COMPLETION_EXECUTOR
, but it’s not.
ClientAsyncConfiguration.Builder asyncConfig = ClientAsyncConfiguration.builder()
.advancedOption(SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR, customExecutor);
SnsAsyncClient.builder()
.asyncConfiguration(asyncConfig.build())
.build();
Example of async request:
snsAsyncClient.publish(publishRequest).thenApplyAsync(..);