语言

CompletableFuture.ThenAcceptAsync 方法

定义

重载

名称 说明
ThenAcceptAsync(IConsumer)

返回一个新的 CompletionStage,当此阶段正常完成时,使用此阶段的默认异步执行工具执行,此阶段的结果作为提供操作的参数。

ThenAcceptAsync(IConsumer, IExecutor)

返回一个新的 CompletionStage,当此阶段正常完成时,使用提供的执行程序执行,此阶段的结果作为提供的操作的参数。

ThenAcceptAsync(IConsumer)

返回一个新的 CompletionStage,当此阶段正常完成时,使用此阶段的默认异步执行工具执行,此阶段的结果作为提供操作的参数。

[Android.Runtime.Register("thenAcceptAsync", "(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;", "GetThenAcceptAsync_Ljava_util_function_Consumer_Handler", ApiSince=24)]
public virtual Java.Util.Concurrent.ICompletionStage? ThenAcceptAsync(Java.Util.Functions.IConsumer? action);
[<Android.Runtime.Register("thenAcceptAsync", "(Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;", "GetThenAcceptAsync_Ljava_util_function_Consumer_Handler", ApiSince=24)>]
abstract member ThenAcceptAsync : Java.Util.Functions.IConsumer -> Java.Util.Concurrent.ICompletionStage
override this.ThenAcceptAsync : Java.Util.Functions.IConsumer -> Java.Util.Concurrent.ICompletionStage

参数

action
IConsumer

完成返回的 CompletionStage 之前要执行的操作

返回

新的 CompletionStage

实现

属性

注解

返回一个新的 CompletionStage,当此阶段正常完成时,使用此阶段的默认异步执行工具执行,此阶段的结果作为提供操作的参数。 有关涵盖异常完成的规则,请参阅 CompletionStage 文档。

Java参考java.util.concurrent.CompletableFuture.thenAcceptAsync。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

ThenAcceptAsync(IConsumer, IExecutor)

返回一个新的 CompletionStage,当此阶段正常完成时,使用提供的执行程序执行,此阶段的结果作为提供的操作的参数。

[Android.Runtime.Register("thenAcceptAsync", "(Ljava/util/function/Consumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "GetThenAcceptAsync_Ljava_util_function_Consumer_Ljava_util_concurrent_Executor_Handler", ApiSince=24)]
public virtual Java.Util.Concurrent.ICompletionStage? ThenAcceptAsync(Java.Util.Functions.IConsumer? action, Java.Util.Concurrent.IExecutor? executor);
[<Android.Runtime.Register("thenAcceptAsync", "(Ljava/util/function/Consumer;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "GetThenAcceptAsync_Ljava_util_function_Consumer_Ljava_util_concurrent_Executor_Handler", ApiSince=24)>]
abstract member ThenAcceptAsync : Java.Util.Functions.IConsumer * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.ICompletionStage
override this.ThenAcceptAsync : Java.Util.Functions.IConsumer * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.ICompletionStage

参数

action
IConsumer

完成返回的 CompletionStage 之前要执行的操作

executor
IExecutor

要用于异步执行的执行程序

返回

新的 CompletionStage

实现

属性

注解

返回一个新的 CompletionStage,当此阶段正常完成时,使用提供的执行程序执行,此阶段的结果作为提供的操作的参数。 有关涵盖异常完成的规则,请参阅 CompletionStage 文档。

Java参考java.util.concurrent.CompletableFuture.thenAcceptAsync。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于