Interface SynchronizerApi.SleepRunGet
-
- All Superinterfaces:
SynchronizerApi.Fluent,SynchronizerApi.RunGet
- All Known Implementing Classes:
Synchronizer
- Enclosing interface:
- SynchronizerApi
public static interface SynchronizerApi.SleepRunGet extends SynchronizerApi.RunGet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default SynchronizerApi.RunGetInvokesleepUntil(BooleanSupplier state)Adds sleeping to the action chain.SynchronizerApi.RunGetInvokesleepUntil(BooleanSupplier state, Duration timeout)Adds sleeping to the action chain.default SynchronizerApi.Run.InvokewakeOthers()Adds an action which wakes other chains.-
Methods inherited from interface com.github.mizool.core.concurrent.SynchronizerApi.RunGet
get, run
-
-
-
-
Method Detail
-
sleepUntil
default SynchronizerApi.RunGetInvoke sleepUntil(BooleanSupplier state)
Adds sleeping to the action chain.
When performing this action, the chain will ensure the given condition is met before performing the next action. 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 proceeds to perform the next action.- Parameters:
state- the supplier that returnstrueif the action chain should continue,falseotherwise.- Throws:
NullPointerException- ifstateis null
-
sleepUntil
SynchronizerApi.RunGetInvoke sleepUntil(BooleanSupplier state, Duration timeout)
Adds sleeping to the action chain.
When performing this action, the chain will ensure the given condition is met before performing the next action. 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 proceeds to perform the next action.- Parameters:
state- the supplier that returnstrueif the action chain should continue,falseotherwise.timeout- the maximum amount of time to sleep before re-checking the condition, ornullto sleep indefinitely.- Throws:
NullPointerException- ifstateis null
-
wakeOthers
default SynchronizerApi.Run.Invoke wakeOthers()
Adds an action which wakes other chains.
-
-