IRejectedExecutionHandler.RejectedExecution 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.
Method that may be invoked by a ThreadPoolExecutor
when
ThreadPoolExecutor#execute execute
cannot accept a
task.
[Android.Runtime.Register("rejectedExecution", "(Ljava/lang/Runnable;Ljava/util/concurrent/ThreadPoolExecutor;)V", "GetRejectedExecution_Ljava_lang_Runnable_Ljava_util_concurrent_ThreadPoolExecutor_Handler:Java.Util.Concurrent.IRejectedExecutionHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public void RejectedExecution (Java.Lang.IRunnable? r, Java.Util.Concurrent.ThreadPoolExecutor? executor);
[<Android.Runtime.Register("rejectedExecution", "(Ljava/lang/Runnable;Ljava/util/concurrent/ThreadPoolExecutor;)V", "GetRejectedExecution_Ljava_lang_Runnable_Ljava_util_concurrent_ThreadPoolExecutor_Handler:Java.Util.Concurrent.IRejectedExecutionHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member RejectedExecution : Java.Lang.IRunnable * Java.Util.Concurrent.ThreadPoolExecutor -> unit
Parameters
the runnable task requested to be executed
- executor
- ThreadPoolExecutor
the executor attempting to execute this task
- Attributes
Exceptions
if there is no remedy
Remarks
Method that may be invoked by a ThreadPoolExecutor
when ThreadPoolExecutor#execute execute
cannot accept a task. This may occur when no more threads or queue slots are available because their bounds would be exceeded, or upon shutdown of the Executor.
In the absence of other alternatives, the method may throw an unchecked RejectedExecutionException
, which will be propagated to the caller of execute
.
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.