言語

AbstractExecutorService.Submit Method

Definition

Overloads

Name Description
Submit(IRunnable)

Submits a Runnable task for execution and returns a Future representing that task.

Submit(ICallable)

Submits a value-returning task for execution and returns a Future representing the pending results of the task.

Submit(IRunnable, Object)

Submits a Runnable task for execution and returns a Future representing that task.

Submit(IRunnable)

Submits a Runnable task for execution and returns a Future representing that task.

[Android.Runtime.Register("submit", "(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_lang_Runnable_Handler")]
public virtual Java.Util.Concurrent.IFuture? Submit(Java.Lang.IRunnable? task);
[<Android.Runtime.Register("submit", "(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_lang_Runnable_Handler")>]
abstract member Submit : Java.Lang.IRunnable -> Java.Util.Concurrent.IFuture
override this.Submit : Java.Lang.IRunnable -> Java.Util.Concurrent.IFuture

Parameters

task
IRunnable

the task to submit

Returns

a Future representing pending completion of the task

Implements

Attributes

Exceptions

Remarks

Submits a Runnable task for execution and returns a Future representing that task. The Future's get method will return null upon successful completion.

Java reference for java.util.concurrent.AbstractExecutorService.submit.

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

Submit(ICallable)

Submits a value-returning task for execution and returns a Future representing the pending results of the task.

[Android.Runtime.Register("submit", "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_util_concurrent_Callable_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public virtual Java.Util.Concurrent.IFuture? Submit(Java.Util.Concurrent.ICallable? task);
[<Android.Runtime.Register("submit", "(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_util_concurrent_Callable_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Submit : Java.Util.Concurrent.ICallable -> Java.Util.Concurrent.IFuture
override this.Submit : Java.Util.Concurrent.ICallable -> Java.Util.Concurrent.IFuture

Parameters

task
ICallable

the task to submit

Returns

a Future representing pending completion of the task

Implements

Attributes

Remarks

Submits a value-returning task for execution and returns a Future representing the pending results of the task. The Future's get method will return the task's result upon successful completion. If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aCallable).get(); Note: The Executors class includes a set of methods that can convert some other common closure-like objects, for example, PrivilegedAction to Callable form so they can be submitted.

Java reference for java.util.concurrent.AbstractExecutorService.submit.

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

Submit(IRunnable, Object)

Submits a Runnable task for execution and returns a Future representing that task.

[Android.Runtime.Register("submit", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_lang_Runnable_Ljava_lang_Object_Handler")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public virtual Java.Util.Concurrent.IFuture? Submit(Java.Lang.IRunnable? task, Java.Lang.Object? result);
[<Android.Runtime.Register("submit", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Future;", "GetSubmit_Ljava_lang_Runnable_Ljava_lang_Object_Handler")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
abstract member Submit : Java.Lang.IRunnable * Java.Lang.Object -> Java.Util.Concurrent.IFuture
override this.Submit : Java.Lang.IRunnable * Java.Lang.Object -> Java.Util.Concurrent.IFuture

Parameters

task
IRunnable

the task to submit

result
Object

the result to return

Returns

a Future representing pending completion of the task

Implements

Attributes

Remarks

Submits a Runnable task for execution and returns a Future representing that task. The Future's get method will return the given result upon successful completion.

Java reference for java.util.concurrent.AbstractExecutorService.submit.

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