java.lang.Object
cn.wjybxx.concurrent.AbstractEventLoopGroup
- 所有已实现的接口:
EventLoopGroup,IExecutor,IExecutorService,IScheduledExecutorService,AutoCloseable,Iterable<EventLoop>,Executor,ExecutorService,ScheduledExecutorService
- 直接已知子类:
DefaultFixedEventLoopGroup
默认的实现仅仅是简单的将任务分配给某个
EventLoop执行- 作者:
- wjybxx date 2023/4/8
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void在将来的某个时间执行给定的命令。void在将来的某个时间执行给定的命令。voidvoidinvokeAll(Collection<? extends Callable<T>> tasks) invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> TinvokeAny(Collection<? extends Callable<T>> tasks) <T> TinvokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) <T> IPromise<T> 创建一个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) 以固定延迟执行给定的任务(少执行了就少执行了) 以固定延迟执行给定的任务(少执行了就少执行了)<T> IFuture<T> submit(TaskBuilder<T> builder) <T> IFuture<T> IFuture<?> submitAction(Runnable task) IFuture<?> submitAction(Runnable task, int options) IFuture<?> submitAction(Consumer<? super IContext> task, IContext ctx) IFuture<?> submitAction(Consumer<? super IContext> task, IContext ctx, int options) <V> IFuture<V> submitFunc(Callable<? extends V> task) <V> IFuture<V> submitFunc(Callable<? extends V> task, int options) <V> IFuture<V> submitFunc(Function<? super IContext, ? extends V> task, IContext ctx) <V> IFuture<V> submitFunc(Function<? super IContext, ? extends V> task, IContext ctx, int options) 从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.wjybxx.concurrent.EventLoopGroup
awaitTermination, isShutdown, isShuttingDown, isTerminated, iterator, select, shutdown, shutdownNow, terminationFuture从接口继承的方法 java.util.concurrent.ExecutorService
close从接口继承的方法 cn.wjybxx.concurrent.IExecutorService
submit, submit从接口继承的方法 cn.wjybxx.concurrent.IScheduledExecutorService
newScheduledPromise从接口继承的方法 java.lang.Iterable
forEach, spliterator
-
构造器详细资料
-
AbstractEventLoopGroup
public AbstractEventLoopGroup()
-
-
方法详细资料
-
execute
从接口复制的说明:IExecutor在将来的某个时间执行给定的命令。 命令可以在新线程中执行,也可以在池线程中执行,或者在调用线程中执行,这由Executor实现决定。Executor.execute(Runnable) -
execute
从接口复制的说明:IExecutor在将来的某个时间执行给定的命令。 命令可以在新线程中执行,也可以在池线程中执行,或者在调用线程中执行,这由Executor实现决定。Executor.execute(Runnable)任务的调度特征值 1.Executor需要感知用户任务的一些属性,以实现更好的管理。 2.选项可参考
TaskOption。 3.该接口不应该测试任务的类型,应当以参数的options为准。- 指定者:
execute在接口中IExecutor- 参数:
command- 要执行的任务options- 任务的调度特征值,见TaskOption
-
execute
从接口复制的说明:IExecutor -
execute
-
newPromise
从接口复制的说明:IExecutorService创建一个promise以用于任务调度 如果当前Executor是SingleThreadExecutor,返回的future将禁止在当前EventLoop上执行阻塞操作。- 指定者:
newPromise在接口中IExecutorService
-
submit
- 指定者:
submit在接口中IExecutorService
-
submit
- 指定者:
submit在接口中ExecutorService- 指定者:
submit在接口中IExecutorService
-
submitFunc
- 指定者:
submitFunc在接口中IExecutorService
-
submitFunc
- 指定者:
submitFunc在接口中IExecutorService
-
submitFunc
- 指定者:
submitFunc在接口中IExecutorService
-
submitFunc
public <V> IFuture<V> submitFunc(Function<? super IContext, ? extends V> task, IContext ctx, int options) - 指定者:
submitFunc在接口中IExecutorService
-
submitAction
- 指定者:
submitAction在接口中IExecutorService
-
submitAction
- 指定者:
submitAction在接口中IExecutorService
-
submitAction
- 指定者:
submitAction在接口中IExecutorService
-
submitAction
- 指定者:
submitAction在接口中IExecutorService
-
schedule
从接口复制的说明:IScheduledExecutorService为避免过多的参数和重载方法,我们通过Builder构建更为复杂的任务。- 指定者:
schedule在接口中IScheduledExecutorService- 类型参数:
V- 任务的结果类型- 参数:
builder- 任务构建器。- 返回:
- future
-
scheduleAction
public IScheduledFuture<?> scheduleAction(Consumer<? super IContext> task, IContext ctx, long delay, TimeUnit unit) 从接口复制的说明:IScheduledExecutorService延迟指定时间后执行给定的任务- 指定者:
scheduleAction在接口中IScheduledExecutorService- 参数:
task- 要执行的任务ctx- 上下文-主要是取消令牌
-
scheduleFunc
public <V> IScheduledFuture<V> scheduleFunc(Function<? super IContext, V> task, IContext ctx, long delay, TimeUnit unit) 从接口复制的说明:IScheduledExecutorService延迟指定时间后执行给定的任务- 指定者:
scheduleFunc在接口中IScheduledExecutorService- 参数:
task- 要执行的任务ctx- 上下文-主要是取消令牌
-
schedule
从接口复制的说明:IScheduledExecutorService延迟指定时间后执行给定的任务- 指定者:
schedule在接口中IScheduledExecutorService- 指定者:
schedule在接口中ScheduledExecutorService
-
schedule
从接口复制的说明:IScheduledExecutorService延迟指定时间后执行给定的任务- 指定者:
schedule在接口中IScheduledExecutorService- 指定者:
schedule在接口中ScheduledExecutorService
-
scheduleWithFixedDelay
@Nonnull public IScheduledFuture<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) 从接口复制的说明:IScheduledExecutorService以固定延迟执行给定的任务(少执行了就少执行了) -
scheduleAtFixedRate
@Nonnull public IScheduledFuture<?> scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit) 从接口复制的说明:IScheduledExecutorService以固定频率执行给定的任务(少执行了会补-慎用)- 指定者:
scheduleAtFixedRate在接口中IScheduledExecutorService- 指定者:
scheduleAtFixedRate在接口中ScheduledExecutorService
-
invokeAll
@Nonnull public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks) throws InterruptedException - 指定者:
invokeAll在接口中ExecutorService- 指定者:
invokeAll在接口中IExecutorService- 抛出:
InterruptedException
-
invokeAll
@Nonnull public <T> List<Future<T>> invokeAll(@Nonnull Collection<? extends Callable<T>> tasks, long timeout, @Nonnull TimeUnit unit) throws InterruptedException - 指定者:
invokeAll在接口中ExecutorService- 指定者:
invokeAll在接口中IExecutorService- 抛出:
InterruptedException
-
invokeAny
@Nonnull public <T> T invokeAny(@Nonnull Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException - 指定者:
invokeAny在接口中ExecutorService- 指定者:
invokeAny在接口中IExecutorService- 抛出:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(@Nonnull Collection<? extends Callable<T>> tasks, long timeout, @Nonnull TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - 指定者:
invokeAny在接口中ExecutorService- 指定者:
invokeAny在接口中IExecutorService- 抛出:
InterruptedExceptionExecutionExceptionTimeoutException
-