Interface SynchronizerApi.Base.SleepInvoke
-
- All Superinterfaces:
SynchronizerApi.Fluent
- All Known Subinterfaces:
SynchronizerApi.Base.WakeSleepInvoke,SynchronizerApi.Get.SleepInvoke<T>,SynchronizerApi.Get.WakeSleepInvoke<T>,SynchronizerApi.Run.SleepInvoke,SynchronizerApi.Run.WakeSleepInvoke
- Enclosing interface:
- SynchronizerApi.Base
public static interface SynchronizerApi.Base.SleepInvoke extends SynchronizerApi.Fluent
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ObjectthenSleepUntil(BooleanSupplier state)Adds sleeping to the action chain.ObjectthenSleepUntil(BooleanSupplier state, Duration timeout)Adds sleeping to the action chain.
-
-
-
Method Detail
-
thenSleepUntil
default Object thenSleepUntil(BooleanSupplier state)
Adds sleeping to the action chain.
When performing this action, the chain will ensure the given condition is met before returning. If the supplier returnsfalse, this action chain sleeps until another chain wakes it up. Then, the supplier is called again and if it still returnsfalse, the chain resumes sleeping. Otherwise, the chain invocation finishes.- Parameters:
state- the supplier that returnstrueif the action chain should finish,falseotherwise.- Throws:
NullPointerException- ifstateis null
-
thenSleepUntil
Object thenSleepUntil(BooleanSupplier state, Duration timeout)
Adds sleeping to the action chain.
When performing this action, the chain will ensure the given condition is met before returning. If the supplier returnsfalse, this action chain sleeps until either another chain wakes it up or the timeout has passed. Then, the supplier is called again and if it still returnsfalse, the chain resumes sleeping. Otherwise, the chain invocation finishes.- Parameters:
state- the supplier that returnstrueif the action chain should finish,falseotherwise.timeout- the maximum amount of time to sleep before re-checking the condition, ornullto sleep indefinitely.- Throws:
NullPointerException- ifstateis null
-
-