All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zalando.riptide.chaos.Sleeper Maven / Gradle / Ivy

The newest version!
package org.zalando.riptide.chaos;

import java.time.Duration;
import java.util.concurrent.CancellationException;

final class Sleeper {

    void sleep(final Duration duration) throws CancellationException {
        try {
            Thread.sleep(duration.toMillis());
        } catch (final InterruptedException e) {
            // preserve interrupt flag
            Thread.currentThread().interrupt();
            throw new CancellationException();
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy