类 ScxScheduler

java.lang.Object
cool.scx.core.scheduler.ScxScheduler

public final class ScxScheduler extends Object
针对 spring 的 $TaskScheduler 进行一些简单的封装
以便可以实现一些简单的任务调度
版本:
1.11.8
作者:
scx567888
  • 构造器详细资料

    • ScxScheduler

      public ScxScheduler(io.netty.channel.EventLoopGroup eventLoopGroup)
      a
      参数:
      eventLoopGroup - a
  • 方法详细资料

    • submit

      public <R> Future<R> submit(cool.scx.functional.ScxHandlerR<R> task)
      a
      类型参数:
      R - a
      参数:
      task - a
      返回:
      a
    • submit

      public Future<?> submit(cool.scx.functional.ScxHandler scxHandlerV)
      a
      参数:
      scxHandlerV - a
      返回:
      a
    • schedule

      public <R> ScheduledFuture<R> schedule(cool.scx.functional.ScxHandlerR<R> scxHandlerVR, long delay, TimeUnit unit)
      a
      类型参数:
      R - a
      参数:
      scxHandlerVR - a
      delay - a
      unit - a
      返回:
      a
    • schedule

      public ScheduledFuture<?> schedule(cool.scx.functional.ScxHandler scxHandlerV, long delay, TimeUnit unit)
      设置计时器

      本质上时内部调用 netty 的线程池完成

      因为java无法做到特别精确的计时所以此处单位采取 毫秒

      参数:
      scxHandlerV - 执行的事件
      delay - 延时执行的时间 单位毫秒
      unit - a
      返回:
      a
    • schedule

      public ScheduledFuture<?> schedule(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, org.springframework.scheduling.Trigger trigger)
      a
      参数:
      scxHandler - a
      trigger - a
      返回:
      a
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Instant startTime, Duration delay)
      a
      参数:
      scxHandler - a
      startTime - a
      delay - a
      返回:
      a
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Instant startTime, Duration delay)
      a
      参数:
      scxHandler - a
      startTime - a
      delay - a
      返回:
      a
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount)
      a
      参数:
      scxHandler - a
      startTime - a
      delay - a
      maxRunCount - a
      返回:
      a
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Instant startTime, Duration delay, long maxRunCount)
      a
      参数:
      scxHandler - a
      startTime - a
      delay - a
      maxRunCount - a
      返回:
      a
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Duration delay)
      a
      参数:
      scxHandler - a
      delay - a
      返回:
      a
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Duration delay)
      a
      参数:
      scxHandler - a
      delay - a
      返回:
      a
    • scheduleWithFixedDelay

      public ScheduledFuture<?> scheduleWithFixedDelay(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Duration delay, long maxRunCount)
      a
      参数:
      scxHandler - a
      delay - a
      maxRunCount - a
      返回:
      a
    • scheduleAtFixedRate

      public ScheduledFuture<?> scheduleAtFixedRate(cool.scx.functional.ScxHandlerA<ScheduleStatus> scxHandler, Duration delay, long maxRunCount)
      a
      参数:
      scxHandler - a
      delay - a
      maxRunCount - a
      返回:
      a