Freigeben über


CompletableFuture.SupplyAsync Method

Definition

Overloads

SupplyAsync(ISupplier)

Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() with the value obtained by calling the given Supplier.

SupplyAsync(ISupplier, IExecutor)

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.

SupplyAsync(ISupplier)

Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() with the value obtained by calling the given Supplier.

[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

Parameters

supplier
ISupplier

a function returning the value to be used to complete the returned CompletableFuture

Returns

the new CompletableFuture

Attributes

Remarks

Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() with the value obtained by calling the given Supplier.

Java documentation for java.util.concurrent.CompletableFuture.supplyAsync(java.util.function.Supplier<U>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SupplyAsync(ISupplier, IExecutor)

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.

[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

Parameters

supplier
ISupplier

a function returning the value to be used to complete the returned CompletableFuture

executor
IExecutor

the executor to use for asynchronous execution

Returns

the new CompletableFuture

Attributes

Remarks

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.

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

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to