Sdílet prostřednictvím


CompletableFuture.OrTimeout(Int64, TimeUnit) Method

Definition

Exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.

[Android.Runtime.Register("orTimeout", "(JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/CompletableFuture;", "GetOrTimeout_JLjava_util_concurrent_TimeUnit_Handler", ApiSince=31)]
public virtual Java.Util.Concurrent.ICompletionStage? OrTimeout (long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("orTimeout", "(JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/CompletableFuture;", "GetOrTimeout_JLjava_util_concurrent_TimeUnit_Handler", ApiSince=31)>]
abstract member OrTimeout : int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.ICompletionStage
override this.OrTimeout : int64 * Java.Util.Concurrent.TimeUnit -> Java.Util.Concurrent.ICompletionStage

Parameters

timeout
Int64

how long to wait before completing exceptionally with a TimeoutException, in units of unit

unit
TimeUnit

a TimeUnit determining how to interpret the timeout parameter

Returns

this CompletableFuture

Attributes

Remarks

Exceptionally completes this CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.

Added in 9.

Java documentation for java.util.concurrent.CompletableFuture.orTimeout(long, java.util.concurrent.TimeUnit).

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