Interface SynchronizerApi.Run.SleepInvoke
- All Superinterfaces:
SynchronizerApi.Base.SleepInvoke,SynchronizerApi.Fluent,SynchronizerApi.Run.Invoke
- All Known Subinterfaces:
SynchronizerApi.Run.WakeSleepInvoke
- Enclosing interface:
- SynchronizerApi.Run
public static interface SynchronizerApi.Run.SleepInvoke
extends SynchronizerApi.Run.Invoke, SynchronizerApi.Base.SleepInvoke
-
Method Summary
Modifier and TypeMethodDescriptiondefault SynchronizerApi.Run.InvokethenSleepUntil(BooleanSupplier state) Adds sleeping to the action chain.thenSleepUntil(BooleanSupplier state, Duration checkInterval) Adds sleeping to the action chain.Methods inherited from interface com.github.mizool.core.concurrent.SynchronizerApi.Run.Invoke
invoke
-
Method Details
-
thenSleepUntil
Description copied from interface:SynchronizerApi.Base.SleepInvokeAdds sleeping to the action chain.
This action ensures the given condition is met before performing the next action. When this action begins, the supplier is called immediately.- Supplier returns
false: -
The chain sleeps until either another chain wakes it up. The supplier is then called again and if
it still returns
false, the chain resumes sleeping. - Supplier returns
true: - The chain proceeds to perform the next action.
- Specified by:
thenSleepUntilin interfaceSynchronizerApi.Base.SleepInvoke- Parameters:
state- the supplier that returnstrueif the action chain should finish,falseotherwise.
- Supplier returns
-
thenSleepUntil
Description copied from interface:SynchronizerApi.Base.SleepInvokeAdds sleeping to the action chain.
This action ensures the given condition is met before performing the next action. When this action begins, the supplier is called immediately.- Supplier returns
false: -
The chain sleeps until either another chain wakes it up or the
checkIntervalhas passed.
In both cases, the supplier is then called again and if it still returnsfalse, the chain resumes sleeping. - Supplier returns
true: - The chain proceeds to perform the next action.
- Specified by:
thenSleepUntilin interfaceSynchronizerApi.Base.SleepInvoke- Parameters:
state- the supplier that returnstrueif the action chain should finish,falseotherwise.checkInterval- how often the condition should be re-checked even if no wake call happens, ornullfor "never".
- Supplier returns
-