Package codes.grow.packages.vault
Interface Scheduler
- All Known Implementing Classes:
Scheduler.SystemScheduler
public interface Scheduler
Clock and timer used by
TokenRenewer and LeaseManager. The default system() uses one shared daemon thread; tests inject a fake to control time.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classWall clock + one shared daemon thread. -
Method Summary
-
Method Details
-
now
Instant now()Returns the current time.- Returns:
- now
-
schedule
Runstaskonce afterdelay.- Parameters:
task- task to rundelay- delay (zero or positive)- Returns:
- a handle; running it cancels the task
-
system
Returns the system scheduler (wall clock, shared daemon timer thread).- Returns:
- the scheduler
-