asyncConfiguration 的目的是什么 SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR?我们应该在哪些用例中使用它?
从 java doc 上FUTURE_COMPLETION_EXECUTOR,我看到:Configure the executor that should be used to complete the CompletableFuture that is returned by the service clients.我认为后续对CompletableFuture异步结果的调用将在传入的执行程序上执行FUTURE_COMPLETION_EXECUTOR,但事实并非如此。
ClientAsyncConfiguration.Builder asyncConfig = ClientAsyncConfiguration.builder()
.advancedOption(SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR, customExecutor);
SnsAsyncClient.builder()
.asyncConfiguration(asyncConfig.build())
.build();
异步请求示例:
snsAsyncClient.publish(publishRequest).thenApplyAsync(..);
www说
相关分类