Package com.sap.cds.feature.mt.lib.tools
Class AsyncPolling
java.lang.Object
com.sap.cds.feature.mt.lib.tools.AsyncPolling
Class that provides an asynchronous polling functionality executed in an own thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for the asynchronous builder -
Method Summary
Modifier and TypeMethodDescription<T> voidexecute(Supplier<PollingResponse<T>> action, Consumer<PollingResponse<T>> finalAction) Start the polling operation
-
Method Details
-
execute
public <T> void execute(Supplier<PollingResponse<T>> action, Consumer<PollingResponse<T>> finalAction) Start the polling operation- Type Parameters:
T- is the type of the result- Parameters:
action- is a lambda expression that is executed periodically until the operation is finished or the maximum runtime is reachedfinalAction- is an optional lambda expression called after the polling.
-
createBuilder
- Returns:
- a builder for the asynchronous polling class
-