Compartir a través de


IRejectedExecutionHandler.RejectedExecution Method

Definition

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

r
IRunnable

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.

Java documentation for java.util.concurrent.RejectedExecutionHandler.rejectedExecution(java.lang.Runnable, java.util.concurrent.ThreadPoolExecutor).

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