-
- 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. -
-
Method Detail
-
schedule
abstract Subscription schedule(Action0 action)
Schedules an Action for execution.
- Parameters:
action
- Action to schedule
-
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 scheduledelayTime
- time to wait before executing the action; non-positive values indicate an non-delayedscheduleunit
- the time unit of{@code delayTime}
-
now
long now()
Gets the current time, in milliseconds, according to this Scheduler.
-
-
-
-