第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

AWS SDK - 異步配置的目的 SdkAdvancedAsyncClientOption.

AWS SDK - 異步配置的目的 SdkAdvancedAsyncClientOption.

幕布斯6054654 2023-03-23 16:17:55
asyncConfiguration 的目的是什么 SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR?我們應(yīng)該在哪些用例中使用它?從 java doc 上FUTURE_COMPLETION_EXECUTOR,我看到:Configure the executor that should be used to complete the CompletableFuture that is returned by the service clients.我認(rèn)為后續(xù)對(duì)CompletableFuture異步結(jié)果的調(diào)用將在傳入的執(zhí)行程序上執(zhí)行FUTURE_COMPLETION_EXECUTOR,但事實(shí)并非如此。ClientAsyncConfiguration.Builder asyncConfig = ClientAsyncConfiguration.builder()        .advancedOption(SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR, customExecutor);SnsAsyncClient.builder()        .asyncConfiguration(asyncConfig.build())        .build();異步請(qǐng)求示例:snsAsyncClient.publish(publishRequest).thenApplyAsync(..);
查看完整描述

1 回答

?
www說

TA貢獻(xiàn)1775條經(jīng)驗(yàn) 獲得超8個(gè)贊

AWS SDK 異步請(qǐng)求返回CompletableFuture。默認(rèn)情況下,對(duì)返回實(shí)例的調(diào)用thenApply(..)和對(duì)返回實(shí)例的調(diào)用將在類似線程上執(zhí)行。async配置的思路是提供線程池executor,用于后續(xù)對(duì)like和 的調(diào)用。該執(zhí)行器將不會(huì)應(yīng)用于像和由于實(shí)現(xiàn)這樣的方法(如果未將執(zhí)行器傳遞給,它將默認(rèn)使用,或者我們可以將自定義執(zhí)行器作為第二個(gè)方法參數(shù)傳遞)。whenComplete(..)CompletableFuturesdk-async-response-0-XSdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTORCompletableFuturethenApply(..)whenComplete(..)thenApplyAsyncwhenCompleteAsyncCompletableFuturethenApplyAsync(..)ForkJoinPool.commonPool()

snsAsyncClient.publish(publishRequest)
        .thenApply(..)
        .whenComplete(..);

內(nèi)部代碼thenApply,whenComplete將在配置的執(zhí)行程序上處理SdkAdvancedAsyncClientOption.FUTURE_COMPLETION_EXECUTOR。


查看完整回答
反對(duì) 回復(fù) 2023-03-23
  • 1 回答
  • 0 關(guān)注
  • 135 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)