- 所有超级接口:
Executor
- 所有已知子接口:
EventLoop,EventLoopGroup,FixedEventLoopGroup,IExecutorService,IScheduledExecutorService,UniExecutorService,UniScheduledExecutor
- 所有已知实现类:
AbstractEventLoop,AbstractEventLoopGroup,AbstractUniExecutor,AbstractUniScheduledExecutor,DefaultFixedEventLoopGroup,DefaultUniExecutor,DefaultUniScheduledExecutor,DisruptorEventLoop
IExecutor在Executor的基础上增加了调度选项。
该接口需要保持较高的抽象,因此将submit之类的方法下沉到子接口。如果需要获取任务结果,
可通过FutureUtils.submitFunc(Executor, Function, IContext)这类工具方法实现。
- 作者:
- wjybxx date - 2024/1/9
-
方法概要
修饰符和类型方法说明void在将来的某个时间执行给定的命令。default void在将来的某个时间执行给定的命令。default voiddefault void
-
方法详细资料
-
execute
在将来的某个时间执行给定的命令。 命令可以在新线程中执行,也可以在池线程中执行,或者在调用线程中执行,这由Executor实现决定。Executor.execute(Runnable)- 指定者:
execute在接口中Executor- 参数:
command- 要执行的任务,注意ITask类型- 抛出:
NullPointerException- 如果任务为nullRejectedExecutionException- 如果Executor已开始关闭
-
execute
在将来的某个时间执行给定的命令。 命令可以在新线程中执行,也可以在池线程中执行,或者在调用线程中执行,这由Executor实现决定。Executor.execute(Runnable)任务的调度特征值 1.Executor需要感知用户任务的一些属性,以实现更好的管理。 2.选项可参考
TaskOption。 3.该接口不应该测试任务的类型,应当以参数的options为准。- 参数:
command- 要执行的任务options- 任务的调度特征值,见TaskOption- 抛出:
NullPointerException- 如果任务为nullRejectedExecutionException- 如果Executor已开始关闭
-
execute
- 参数:
action- 要执行的任务ctx- 任务绑定的上下文- 抛出:
NullPointerException- 如果任务为nullRejectedExecutionException- 如果Executor已开始关闭
-
execute
-