Language

CompletableFuture.ExceptionallyComposeAsync Method

Definition

Overloads

Name Description
ExceptionallyComposeAsync(IFunction)

Creates a dependent future that can recover from a failed completion with a stage supplied asynchronously.

ExceptionallyComposeAsync(IFunction, IExecutor)

Creates a dependent future that can recover from a failed completion with a stage supplied using the specified executor.

ExceptionallyComposeAsync(IFunction)

Creates a dependent future that can recover from a failed completion with a stage supplied asynchronously.

[Android.Runtime.Register("exceptionallyComposeAsync", "(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionallyComposeAsync_Ljava_util_function_Function_Handler", ApiSince=34)]
public virtual Java.Util.Concurrent.ICompletionStage? ExceptionallyComposeAsync(Java.Util.Functions.IFunction? fn);
[<Android.Runtime.Register("exceptionallyComposeAsync", "(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionallyComposeAsync_Ljava_util_function_Function_Handler", ApiSince=34)>]
abstract member ExceptionallyComposeAsync : Java.Util.Functions.IFunction -> Java.Util.Concurrent.ICompletionStage
override this.ExceptionallyComposeAsync : Java.Util.Functions.IFunction -> Java.Util.Concurrent.ICompletionStage

Parameters

fn
IFunction

The function that receives the failed completion's exception and supplies a recovery stage.

Returns

A dependent future that receives the original successful value or follows the completion of the stage supplied by fn.

Implements

Attributes

Remarks

The recovery function uses this future's default executor. It is not called when this future completes successfully. The dependent future follows the returned stage's value or failure; if the function throws, it completes exceptionally.

Applies to

ExceptionallyComposeAsync(IFunction, IExecutor)

Creates a dependent future that can recover from a failed completion with a stage supplied using the specified executor.

[Android.Runtime.Register("exceptionallyComposeAsync", "(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionallyComposeAsync_Ljava_util_function_Function_Ljava_util_concurrent_Executor_Handler", ApiSince=34)]
public virtual Java.Util.Concurrent.ICompletionStage? ExceptionallyComposeAsync(Java.Util.Functions.IFunction? fn, Java.Util.Concurrent.IExecutor? executor);
[<Android.Runtime.Register("exceptionallyComposeAsync", "(Ljava/util/function/Function;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;", "GetExceptionallyComposeAsync_Ljava_util_function_Function_Ljava_util_concurrent_Executor_Handler", ApiSince=34)>]
abstract member ExceptionallyComposeAsync : Java.Util.Functions.IFunction * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.ICompletionStage
override this.ExceptionallyComposeAsync : Java.Util.Functions.IFunction * Java.Util.Concurrent.IExecutor -> Java.Util.Concurrent.ICompletionStage

Parameters

fn
IFunction

The function that receives the failed completion's exception and supplies a recovery stage.

executor
IExecutor

The executor used to run the recovery function.

Returns

A dependent future that receives the original successful value or follows the completion of the stage supplied by fn.

Implements

Attributes

Remarks

The recovery function is not called when this future completes successfully. The dependent future follows the returned stage's value or failure; if the function throws, it completes exceptionally.

Applies to