- 所有超级接口:
AutoCloseable,Executor,ExecutorService,IExecutor,IExecutorService,ScheduledExecutorService
- 所有已知实现类:
AbstractEventLoop,AbstractEventLoopGroup,AbstractUniScheduledExecutor,DefaultFixedEventLoopGroup,DefaultUniScheduledExecutor,DisruptorEventLoop
不继承
ScheduledExecutorService,JDK的ScheduledFuture设计有问题。- 作者:
- wjybxx date - 2024/1/9
-
方法概要
修饰符和类型方法说明default <V> IScheduledPromise<V> 创建一个promise以用于任务调度 如果当前Executor是SingleThreadExecutor,返回的future将禁止在当前EventLoop上执行阻塞操作。<V> IScheduledFuture<V> schedule(ScheduledTaskBuilder<V> builder) 为避免过多的参数和重载方法,我们通过Builder构建更为复杂的任务。延迟指定时间后执行给定的任务<V> IScheduledFuture<V> 延迟指定时间后执行给定的任务scheduleAction(Consumer<? super IContext> task, IContext ctx, long delay, TimeUnit unit) 延迟指定时间后执行给定的任务scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit) 以固定频率执行给定的任务(少执行了会补-慎用)<V> IScheduledFuture<V> scheduleFunc(Function<? super IContext, V> task, IContext ctx, long delay, TimeUnit unit) 延迟指定时间后执行给定的任务scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) 以固定延迟执行给定的任务(少执行了就少执行了)从接口继承的方法 java.util.concurrent.ExecutorService
close从接口继承的方法 cn.wjybxx.concurrent.IExecutorService
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isShuttingDown, isTerminated, newPromise, shutdown, shutdownNow, submit, submit, submit, submit, submitAction, submitAction, submitAction, submitAction, submitFunc, submitFunc, submitFunc, submitFunc, terminationFuture
-
方法详细资料
-
newScheduledPromise
创建一个promise以用于任务调度 如果当前Executor是SingleThreadExecutor,返回的future将禁止在当前EventLoop上执行阻塞操作。 -
schedule
为避免过多的参数和重载方法,我们通过Builder构建更为复杂的任务。- 类型参数:
V- 任务的结果类型- 参数:
builder- 任务构建器。- 返回:
- future
-
scheduleFunc
<V> IScheduledFuture<V> scheduleFunc(Function<? super IContext, V> task, IContext ctx, long delay, TimeUnit unit) 延迟指定时间后执行给定的任务- 参数:
task- 要执行的任务ctx- 上下文-主要是取消令牌
-
scheduleAction
IScheduledFuture<?> scheduleAction(Consumer<? super IContext> task, IContext ctx, long delay, TimeUnit unit) 延迟指定时间后执行给定的任务- 参数:
task- 要执行的任务ctx- 上下文-主要是取消令牌
-
schedule
延迟指定时间后执行给定的任务- 指定者:
schedule在接口中ScheduledExecutorService
-
schedule
延迟指定时间后执行给定的任务- 指定者:
schedule在接口中ScheduledExecutorService
-
scheduleWithFixedDelay
IScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) 以固定延迟执行给定的任务(少执行了就少执行了) -
scheduleAtFixedRate
IScheduledFuture<?> scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit) 以固定频率执行给定的任务(少执行了会补-慎用)- 指定者:
scheduleAtFixedRate在接口中ScheduledExecutorService
-