public interface Sleeper
Modifier and Type | Method and Description |
---|---|
void |
sleep(java.time.Duration duration)
Sleeps for the given duration.
|
default void |
sleep(java.util.function.Supplier<java.time.Duration> durationSupplier)
Sleeps for given duration but period wake-up by new interval supplier.
|
void sleep(java.time.Duration duration) throws InterruptedException
duration
- the duration to sleep forInterruptedException
- if the sleep is interrupteddefault void sleep(java.util.function.Supplier<java.time.Duration> durationSupplier) throws InterruptedException
durationSupplier
- New sleep interval supplierInterruptedException
Copyright © 2023. All Rights Reserved.