
org.zalando.riptide.chaos.Sleeper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of riptide-chaos Show documentation
Show all versions of riptide-chaos Show documentation
Client side response routing
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