Class AsLongAsMediator
java.lang.Object
ch.nolix.base.programcontrol.flowcontrol.AsLongAsMediator
- All Implemented Interfaces:
IAsLongAsMediator
A
AsLongAsMediator is not mutable.- Author:
- Silvan Wyss
-
Method Summary
Modifier and TypeMethodDescriptionafterEveryMilliseconds(int timeIntervalInMilliseconds) voidLets the currentIAsLongAsMediatorrun the given job.runInBackground(Runnable step) Lets the currentIAsLongAsMediatorrun the given step asynchronously in background.static AsLongAsMediatorwithCondition(BooleanSupplier condition)
-
Method Details
-
withCondition
- Parameters:
condition-- Returns:
- a new
AsLongAsMediatorwith the given condition. - Throws:
RuntimeException- if the given condition is null.
-
afterEveryMilliseconds
- Specified by:
afterEveryMillisecondsin interfaceIAsLongAsMediator- Parameters:
timeIntervalInMilliseconds-- Returns:
- a new
IAfterEveryMediatorwith the given timeIntervalInMilliseconds.
-
afterEverySecond
- Specified by:
afterEverySecondin interfaceIAsLongAsMediator- Returns:
- a new
IAfterEveryMediatorwith a time interval of 1 second.
-
run
Lets the currentIAsLongAsMediatorrun the given job.- Specified by:
runin interfaceIAsLongAsMediator- Parameters:
job-
-
runInBackground
Lets the currentIAsLongAsMediatorrun the given step asynchronously in background.- Specified by:
runInBackgroundin interfaceIAsLongAsMediator- Parameters:
step-- Returns:
- a new
IFuture.
-