Share via


CompletableFuture.RunAsync Method

Definition

Overloads

RunAsync(IRunnable)

Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() after it runs the given action.

RunAsync(IRunnable, IExecutor)

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.

RunAsync(IRunnable)

Returns a new CompletableFuture that is asynchronously completed by a task running in the ForkJoinPool#commonPool() after it runs the given action.

[Android.Runtime.Register("runAsync", "(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)]
public static Java.Util.Concurrent.CompletableFuture? RunAsync (Java.Lang.IRunnable? runnable);
[<Android.Runtime.Register("runAsync", "(Ljava/lang/Runnable;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)>]
static member RunAsync : Java.Lang.IRunnable -> Java.Util.Concurrent.CompletableFuture

Parameters

runnable
IRunnable

the action to run before completing 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() after it runs the given action.

Java documentation for java.util.concurrent.CompletableFuture.runAsync(java.lang.Runnable).

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

RunAsync(IRunnable, IExecutor)

Returns a new CompletableFuture that is asynchronously completed by a task running in the given executor after it runs the given action.

[Android.Runtime.Register("runAsync", "(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)]
public static Java.Util.Concurrent.CompletableFuture? RunAsync (Java.Lang.IRunnable? runnable, Java.Util.Concurrent.IExecutor? executor);
[<Android.Runtime.Register("runAsync", "(Ljava/lang/Runnable;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "", ApiSince=24)>]
static member RunAsync : Java.Lang.IRunnable * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.CompletableFuture

Parameters

runnable
IRunnable

the action to run before completing 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 after it runs the given action.

Java documentation for java.util.concurrent.CompletableFuture.runAsync(java.lang.Runnable, 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