Interface SynchronizerApi.Get.SleepInvoke<T>
-
- All Superinterfaces:
SynchronizerApi.Base.SleepInvoke
,SynchronizerApi.Fluent
,SynchronizerApi.Get.Invoke<T>
- All Known Subinterfaces:
SynchronizerApi.Get.WakeSleepInvoke<T>
- Enclosing interface:
- SynchronizerApi.Get
public static interface SynchronizerApi.Get.SleepInvoke<T> extends SynchronizerApi.Get.Invoke<T>, SynchronizerApi.Base.SleepInvoke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default SynchronizerApi.Get.Invoke<T>
thenSleepUntil(BooleanSupplier state)
Adds sleeping to the action chain.SynchronizerApi.Get.Invoke<T>
thenSleepUntil(BooleanSupplier state, Duration checkInterval)
Adds sleeping to the action chain.-
Methods inherited from interface com.github.mizool.core.concurrent.SynchronizerApi.Get.Invoke
invoke
-
-
-
-
Method Detail
-
thenSleepUntil
default SynchronizerApi.Get.Invoke<T> thenSleepUntil(BooleanSupplier state)
Description copied from interface:SynchronizerApi.Base.SleepInvoke
Adds 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:
thenSleepUntil
in interfaceSynchronizerApi.Base.SleepInvoke
- Parameters:
state
- the supplier that returnstrue
if the action chain should finish,false
otherwise.
- Supplier returns
-
thenSleepUntil
SynchronizerApi.Get.Invoke<T> thenSleepUntil(BooleanSupplier state, Duration checkInterval)
Description copied from interface:SynchronizerApi.Base.SleepInvoke
Adds 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
checkInterval
has 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:
thenSleepUntil
in interfaceSynchronizerApi.Base.SleepInvoke
- Parameters:
state
- the supplier that returnstrue
if the action chain should finish,false
otherwise.checkInterval
- how often the condition should be re-checked even if no wake call happens, ornull
for "never".
- Supplier returns
-
-