Interface FluentSynchronizerApi.Void
- All Superinterfaces:
FluentSynchronizerApi.Common
- All Known Subinterfaces:
FluentSynchronizerApi.VoidInvoke
- Enclosing interface:
- FluentSynchronizerApi
-
Method Summary
Modifier and TypeMethodDescription<T extends @Nullable Object>
FluentSynchronizerApi.Value<T>Adds an action to the chain that calls the givenSupplier.Adds an action to the chain that calls the givenRunnable.sleepUntil(BooleanSupplier state) Adds sleeping to the action chain.sleepUntil(BooleanSupplier state, Duration checkInterval) Adds sleeping to the action chain.Adds an action which wakes other chains.
-
Method Details
-
run
Adds an action to the chain that calls the givenRunnable.- Parameters:
runnable- the runnable to call- Throws:
NullPointerException- ifrunnableis null
-
get
Adds an action to the chain that calls the givenSupplier.The value returned by the supplier is kept as the chain result and will be returned by the chain invocation. Intermediate actions can be used to transform or discard the chain result.
- Parameters:
supplier- the supplier to call- Throws:
NullPointerException- ifsupplieris null
-
sleepUntil
Description copied from interface:FluentSynchronizerApi.CommonAdds 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 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:
sleepUntilin interfaceFluentSynchronizerApi.Common- Parameters:
state- the supplier that returnstrueif the action chain should proceed to the next action,falseotherwise.
- Supplier returns
-
sleepUntil
Description copied from interface:FluentSynchronizerApi.CommonAdds 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 returns
false, the chain resumes sleeping. - Supplier returns
true: - The chain proceeds to perform the next action.
- Specified by:
sleepUntilin interfaceFluentSynchronizerApi.Common- Parameters:
state- the supplier that returnstrueif the action chain should proceed to the next action,falseotherwise.checkInterval- how often the condition should be re-checked even if no wake call happens, ornullfor "never".
- Supplier returns
-
wakeOthers
FluentSynchronizerApi.VoidInvoke wakeOthers()Description copied from interface:FluentSynchronizerApi.CommonAdds an action which wakes other chains.- Specified by:
wakeOthersin interfaceFluentSynchronizerApi.Common
-