Interface Sleeper


  • public interface Sleeper
    Abstraction around Thread.sleep(long) to permit better testability.
    • Field Detail

      • SYSTEM_SLEEPER

        static final Sleeper SYSTEM_SLEEPER
    • Method Detail

      • sleep

        void sleep​(java.time.Duration duration)
            throws java.lang.InterruptedException
        Sleeps for the specified duration of time.
        Parameters:
        duration - How long to sleep.
        Throws:
        java.lang.InterruptedException - If the thread is interrupted while sleeping.