Package org.apache.beam.sdk.util
Interface Sleeper
-
public interface Sleeper
Sleeper interface to use for requesting the current thread to sleep as specified inThread.sleep(long)
.The default implementation can be accessed at
DEFAULT
. Primarily used for testing.Note: This interface is copied from Google API client library to avoid its dependency.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
sleep(long millis)
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.
-
-
-
Field Detail
-
DEFAULT
static final Sleeper DEFAULT
Provides the default implementation based onThread.sleep(long)
.
-
-
Method Detail
-
sleep
void sleep(long millis) throws java.lang.InterruptedException
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.- Parameters:
millis
- length of time to sleep in milliseconds- Throws:
java.lang.InterruptedException
- if any thread has interrupted the current thread
-
-