接口的使用
cn.wjybxx.concurrent.IExecutorService
使用IExecutorService的程序包
-
cn.wjybxx.concurrent中IExecutorService的使用
修饰符和类型接口说明interface事件循环 它是单线程的,它保证任务不会并发执行,且任务的执行顺序和提交顺序一致。interface事件循环线程组,它管理着一组EventLoop。interfaceinterface不继承ScheduledExecutorService,JDK的ScheduledFuture设计有问题。修饰符和类型类说明classclass默认的实现仅仅是简单的将任务分配给某个EventLoop执行classclassDisruptorEventLoop<T extends IAgentEvent>基于Disruptor框架的事件循环。参数类型为IExecutorService的cn.wjybxx.concurrent中的构造器 -
cn.wjybxx.sequential中IExecutorService的使用
修饰符和类型接口说明interface用于在当前线程延迟执行任务的Executor --IExecutorService。interface定时任务调度器,时间单位取决于具体的实现,通常是毫秒 -- 也可能是帧数。修饰符和类型类说明classclass子类需要在AbstractUniExecutor.execute(Runnable)的时候为任务赋值id和optionsclass默认的executor实现,通过限制每帧执行的任务数来平滑开销class