語言

CompletableFuture.SupplyAsync 方法

定義

多載

名稱 Description
SupplyAsync(ISupplier, IExecutor)

回傳一個新的 CompletableFuture,該任務由在指定執行者中執行的任務非同步完成,該任務的值與呼叫給定供應商所得。

SupplyAsync(ISupplier)

回傳一個新的 CompletableFuture,該任務由在 中 ForkJoinPool#commonPool() 執行的任務非同步完成,該任務的值與呼叫給定供應商所得的值相同。

SupplyAsync(ISupplier, IExecutor)

回傳一個新的 CompletableFuture,該任務由在指定執行者中執行的任務非同步完成,該任務的值與呼叫給定供應商所得。

[Android.Runtime.Register("supplyAsync", "(Ljava/util/function/Supplier;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "U" })]
public static Java.Util.Concurrent.CompletableFuture? SupplyAsync(Java.Util.Functions.ISupplier? supplier, Java.Util.Concurrent.IExecutor? executor);
[<Android.Runtime.Register("supplyAsync", "(Ljava/util/function/Supplier;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "U" })>]
static member SupplyAsync : Java.Util.Functions.ISupplier * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.CompletableFuture

參數

supplier
ISupplier

一個回傳用來完成 CompletableFuture 的值的函式

executor
IExecutor

執行者用於非同步執行

傳回

全新的CompletableFuture

屬性

備註

回傳一個新的 CompletableFuture,該任務由在指定執行者中執行的任務非同步完成,該任務的值與呼叫給定供應商所得。

Java 文件 java.util.concurrent.CompletableFuture.supplyAsync(java.util.function.Supplier<U>, java.util.concurrent.Executor)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於

SupplyAsync(ISupplier)

回傳一個新的 CompletableFuture,該任務由在 中 ForkJoinPool#commonPool() 執行的任務非同步完成,該任務的值與呼叫給定供應商所得的值相同。

[Android.Runtime.Register("supplyAsync", "(Ljava/util/function/Supplier;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)]
[Java.Interop.JavaTypeParameters(new System.String[] { "U" })]
public static Java.Util.Concurrent.CompletableFuture? SupplyAsync(Java.Util.Functions.ISupplier? supplier);
[<Android.Runtime.Register("supplyAsync", "(Ljava/util/function/Supplier;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "U" })>]
static member SupplyAsync : Java.Util.Functions.ISupplier -> Java.Util.Concurrent.CompletableFuture

參數

supplier
ISupplier

一個回傳用來完成 CompletableFuture 的值的函式

傳回

全新的CompletableFuture

屬性

備註

回傳一個新的 CompletableFuture,該任務由在 中 ForkJoinPool#commonPool() 執行的任務非同步完成,該任務的值與呼叫給定供應商所得的值相同。

Java 文件 java.util.concurrent.CompletableFuture.supplyAsync(java.util.function.Supplier<U>)

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於