Interface Repeat<C extends FlowContext>
- Type Parameters:
C- the type of the context shared between tasks
- All Superinterfaces:
Promisable<C>, Subscription<C>
An interface to control the repeated execution of an
asynchronous task.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanBy default, the execution of task fails fast.static final longBy default, no interval is used between the iterations.static final intBy default, the number of iterations is infinite.static final longBy default, the timeout for the loop is 10 seconds. -
Method Summary
Modifier and TypeMethodDescriptionfailFast(boolean failFast) Whether the execution of the task should fail fast or fail last.interval(long interval) The interval in milliseconds between the iterations.iterations(int iterations) The maximal number of iterations of the loop.timeout(long timeout) The timeout in milliseconds for the while loop.The task is executed as long as the given predicate evaluates totrue.Methods inherited from interface Subscription
subscribe
-
Field Details
-
DEFAULT_FAIL_FAST
-
DEFAULT_INTERVAL
static final long DEFAULT_INTERVALBy default, no interval is used between the iterations.- See Also:
-
DEFAULT_TIMEOUT
static final long DEFAULT_TIMEOUTBy default, the timeout for the loop is 10 seconds.- See Also:
-
DEFAULT_ITERATIONS
static final int DEFAULT_ITERATIONSBy default, the number of iterations is infinite.- See Also:
-
-
Method Details
-
while_
-
failFast
-
interval
The interval in milliseconds between the iterations. Defaults to 0L<C extends FlowContext> milliseconds. -
timeout
The timeout in milliseconds for the while loop. Defaults to 10000L<C extends FlowContext> milliseconds. -
iterations
The maximal number of iterations of the loop. Defaults to an infinite loop (-1<C extends FlowContext>).
-