标签:
java原生的接口和抽象类:Executor、ExecutorService、ScheduleExecutorService、Iterable和AbstractExecutorService;
ScheduleExecutorService接口:提供了延迟执行、周期性执行的接口。
AbstractExecutorService抽象类:实现了任务提交和调用。
netty实现
EventExecutorGroup接口:
public interface EventExecutorGroup extends ScheduledExecutorService, Iterable<EventExecutor> {
在ScheduleExecutorService和Iterable的基础上增加了以下接口:
boolean isShuttingDown(); Future<?> shutdownGracefully(); Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit); Future<?> terminationFuture(); EventExecutor next();
EventExecutorGroup继承Iterable接口表明他是一个EventExecutor容器。
EventExecutor接口:
public interface EventExecutor extends EventExecutorGroup {
在EventExecutorGroup的基础上增加了以下接口:
EventExecutorGroup parent(); boolean inEventLoop(); boolean inEventLoop(Thread thread); <V> Promise<V> newPromise(); <V> ProgressivePromise<V> newProgressivePromise(); <V> Future<V> newSucceededFuture(V result); <V> Future<V> newFailedFuture(Throwable cause);
标签:
原文地址:http://www.cnblogs.com/barker/p/5367690.html