Package 

Class Scheduler.Worker

  • All Implemented Interfaces:
    com.tds.common.reactor.Subscription

    
    public abstract class Scheduler.Worker
     implements Subscription
                        

    Sequential Scheduler for executing actions on a single thread or event loop.

    Unsubscribing the Worker cancels all outstanding work and allows resources cleanup.

    • Method Summary

      Modifier and Type Method Description
      abstract Subscription schedule(Action0 action) Schedules an Action for execution.
      abstract Subscription schedule(Action0 action, long delayTime, TimeUnit unit) Schedules an Action for execution at some point in the future.
      long now() Gets the current time, in milliseconds, according to this Scheduler.
      • Methods inherited from class com.tds.common.reactor.Subscription

        isUnsubscribed, unsubscribe
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • schedule

         abstract Subscription schedule(Action0 action, long delayTime, TimeUnit unit)

        Schedules an Action for execution at some point in the future.

        Note to implementors: non-positive {@code delayTime} should be regarded as non-delayed schedule, i.e.,as if the schedule was called.

        Parameters:
        action - the Action to schedule
        delayTime - time to wait before executing the action; non-positive values indicate an non-delayedschedule
        unit - the time unit of {@code delayTime}
      • now

         long now()

        Gets the current time, in milliseconds, according to this Scheduler.