Executors.Callable 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
Callable(IRunnable) |
Returns a |
Callable(IPrivilegedAction) |
Returns a |
Callable(IPrivilegedExceptionAction) |
Returns a |
Callable(IRunnable, Object) |
Returns a |
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.
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.