AbstractExecutorService.InvokeAny Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| InvokeAny(ICollection) |
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do. |
| InvokeAny(ICollection, Int64, TimeUnit) |
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. |
InvokeAny(ICollection)
Executes the given tasks, returning the result of one that has completed successfully (i.e., without throwing an exception), if any do.
[Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public virtual Java.Lang.Object? InvokeAny(System.Collections.ICollection? tasks);
[<Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member InvokeAny : System.Collections.ICollection -> Java.Lang.Object
override this.InvokeAny : System.Collections.ICollection -> Java.Lang.Object
Parameters
- tasks
- ICollection
the collection of tasks
Returns
the result returned by one of the tasks
Implements
- 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 reference for java.util.concurrent.AbstractExecutorService.invokeAny.
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.e., without throwing an exception), if any do before the given timeout elapses.
[Android.Runtime.Register("invokeAny", "(Ljava/util/Collection;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;", "GetInvokeAny_Ljava_util_Collection_JLjava_util_concurrent_TimeUnit_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public virtual 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.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member InvokeAny : System.Collections.ICollection * int64 * Java.Util.Concurrent.TimeUnit -> Java.Lang.Object
override this.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
Implements
- 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 reference for java.util.concurrent.AbstractExecutorService.invokeAny.
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.