Package io.unitycatalog.client.internal
Interface Clock
- All Known Implementing Classes:
Clock.ManualClock,Clock.SystemClock
public interface Clock
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic ClockgetManualClock(String name) static ClockmanualClock(Instant now) now()static voidremoveManualClock(String name) voidSleeps for the given duration.static Clock
-
Method Details
-
now
Instant now()- Returns:
- the current time of the clock.
-
sleep
Sleeps for the given duration.For system clock, this performs an actual sleep by calling
Thread.sleep(long). For manual clock, this advances the clock time by the given duration without sleeping.- Parameters:
duration- the duration to sleep- Throws:
InterruptedException- if the sleep is interrupted (only for system clock)
-
systemClock
-
manualClock
-
getManualClock
-
removeManualClock
-