Share via


IExecutorService.InvokeAny Method

Definition

Overloads

InvokeAny(ICollection)

Executes the given tasks, returning the result of one that has completed successfully (i.

InvokeAny(ICollection, Int64, TimeUnit)

Executes the given tasks, returning the result of one that has completed successfully (i.

InvokeAny(ICollection)

Executes the given tasks, returning the result of one that has completed successfully (i.

[Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? InvokeAny (System.Collections.ICollection? tasks);
[<Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member InvokeAny : System.Collections.ICollection -> Java.Lang.Object

Parameters

tasks
ICollection

the collection of tasks

Returns

the result returned by one of the tasks

Attributes

Remarks

Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do. Upon normal or exceptional return, tasks that have not completed are cancelled. The results of this method are undefined if the given collection is modified while this operation is in progress.

Java documentation for java.util.concurrent.ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>).

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

InvokeAny(ICollection, Int64, TimeUnit)

Executes the given tasks, returning the result of one that has completed successfully (i.

[Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public Java.Lang.Object? InvokeAny (System.Collections.ICollection? tasks, long timeout, Java.Util.Concurrent.TimeUnit? unit);
[<Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_JLjava_util_concurrent_TimeUnit_Handler:Java.Util.Concurrent.IExecutorServiceInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member InvokeAny : System.Collections.ICollection * int64 * Java.Util.Concurrent.TimeUnit -> Java.Lang.Object

Parameters

tasks
ICollection

the collection of tasks

timeout
Int64

the maximum time to wait

unit
TimeUnit

the time unit of the timeout argument

Returns

the result returned by one of the tasks

Attributes

Remarks

Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do before the given timeout elapses. Upon normal or exceptional return, tasks that have not completed are cancelled. The results of this method are undefined if the given collection is modified while this operation is in progress.

Java documentation for java.util.concurrent.ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>, 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