接口 RejectedExecutionHandler


public interface RejectedExecutionHandler
当提交的任务被拒绝时的处理策略,修改自JDK的或者说Netty的拒绝策略。
作者:
wjybxx date 2023/4/7
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    rejected(Runnable r, EventLoop eventLoop)
    Method that may be invoked by a EventLoop when execute cannot accept a task.
  • 方法详细资料

    • rejected

      void rejected(Runnable r, EventLoop eventLoop)
      Method that may be invoked by a EventLoop when 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.

      参数:
      r - the runnable task requested to be executed
      eventLoop - the executor attempting to execute this task
      抛出:
      RejectedExecutionException - if there is no remedy