|
YAACC - UPNP Client and Server
|
Waits, bounded, until something becomes true (for example the local HTTP server accepts connections after a cold start). More...

Classes | |
| interface | Sleeper |
| How the waiting thread sleeps. More... | |
Static Public Member Functions | |
| static boolean | await (BooleanSupplier ready, long maxMillis, long pollMillis) |
Same with the system clock and Thread#sleep. | |
| static boolean | await (BooleanSupplier ready, long maxMillis, long pollMillis, LongSupplier clock, Sleeper sleeper) |
Checks ready, then every pollMillis until it is true or maxMillis have passed (one last check at the end). | |
Waits, bounded, until something becomes true (for example the local HTTP server accepts connections after a cold start).
Plain Java with an injectable clock and sleeper. Blocks the calling thread: never call it on the main thread.
|
static |
Checks ready, then every pollMillis until it is true or maxMillis have passed (one last check at the end).
A check that throws counts as not ready. An interrupt ends the wait with false and keeps the thread's interrupt flag.
ready became true in time