Share via


Executors.Callable Method

Definition

Overloads

Callable(IRunnable)

Returns a Callable object that, when called, runs the given task and returns null.

Callable(IPrivilegedAction)

Returns a Callable object that, when called, runs the given privileged action and returns its result.

Callable(IPrivilegedExceptionAction)

Returns a Callable object that, when called, runs the given privileged exception action and returns its result.

Callable(IRunnable, Object)

Returns a Callable object that, when called, runs the given task and returns the given result.

Callable(IRunnable)

Returns a Callable object that, when called, runs the given task and returns null.

[Android.Runtime.Register("callable", "(Ljava/lang/Runnable;)Ljava/util/concurrent/Callable;", "")]
public static Java.Util.Concurrent.ICallable? Callable (Java.Lang.IRunnable? task);
[<Android.Runtime.Register("callable", "(Ljava/lang/Runnable;)Ljava/util/concurrent/Callable;", "")>]
static member Callable : Java.Lang.IRunnable -> Java.Util.Concurrent.ICallable

Parameters

task
IRunnable

the task to run

Returns

a callable object

Attributes

Exceptions

if task null

Remarks

Returns a Callable object that, when called, runs the given task and returns null.

Java documentation for java.util.concurrent.Executors.callable(java.lang.Runnable).

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

Callable(IPrivilegedAction)

Returns a Callable object that, when called, runs the given privileged action and returns its result.

[Android.Runtime.Register("callable", "(Ljava/security/PrivilegedAction;)Ljava/util/concurrent/Callable;", "")]
public static Java.Util.Concurrent.ICallable? Callable (Java.Security.IPrivilegedAction? action);
[<Android.Runtime.Register("callable", "(Ljava/security/PrivilegedAction;)Ljava/util/concurrent/Callable;", "")>]
static member Callable : Java.Security.IPrivilegedAction -> Java.Util.Concurrent.ICallable

Parameters

action
IPrivilegedAction

the privileged action to run

Returns

a callable object

Attributes

Remarks

Returns a Callable object that, when called, runs the given privileged action and returns its result.

Java documentation for java.util.concurrent.Executors.callable(java.security.PrivilegedAction<?>).

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

Callable(IPrivilegedExceptionAction)

Returns a Callable object that, when called, runs the given privileged exception action and returns its result.

[Android.Runtime.Register("callable", "(Ljava/security/PrivilegedExceptionAction;)Ljava/util/concurrent/Callable;", "")]
public static Java.Util.Concurrent.ICallable? Callable (Java.Security.IPrivilegedExceptionAction? action);
[<Android.Runtime.Register("callable", "(Ljava/security/PrivilegedExceptionAction;)Ljava/util/concurrent/Callable;", "")>]
static member Callable : Java.Security.IPrivilegedExceptionAction -> Java.Util.Concurrent.ICallable

Parameters

action
IPrivilegedExceptionAction

the privileged exception action to run

Returns

a callable object

Attributes

Remarks

Returns a Callable object that, when called, runs the given privileged exception action and returns its result.

Java documentation for java.util.concurrent.Executors.callable(java.security.PrivilegedExceptionAction<?>).

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

Callable(IRunnable, Object)

Returns a Callable object that, when called, runs the given task and returns the given result.

[Android.Runtime.Register("callable", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Callable;", "")]
[Java.Interop.JavaTypeParameters(new System.String[] { "T" })]
public static Java.Util.Concurrent.ICallable? Callable (Java.Lang.IRunnable? task, Java.Lang.Object? result);
[<Android.Runtime.Register("callable", "(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Callable;", "")>]
[<Java.Interop.JavaTypeParameters(new System.String[] { "T" })>]
static member Callable : Java.Lang.IRunnable * Java.Lang.Object -> Java.Util.Concurrent.ICallable

Parameters

task
IRunnable

the task to run

result
Object

the result to return

Returns

a callable object

Attributes

Remarks

Returns a Callable object that, when called, runs the given task and returns the given result. This can be useful when applying methods requiring a Callable to an otherwise resultless action.

Java documentation for java.util.concurrent.Executors.callable(java.lang.Runnable, 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