public class RunnableChain
extends java.lang.Object
implements java.lang.Runnable
RunnableChain(boolean, Iterable)
the iterator is not requested until
execution is starting. This can allow you to delay knowing which tasks to execute until
execution is starting.Constructor and Description |
---|
RunnableChain(boolean exceptionStopsChain,
java.lang.Iterable<? extends java.lang.Runnable> toRun)
Constructs a runnable chain with an
Iterable . |
RunnableChain(boolean exceptionStopsChain,
java.lang.Runnable... runnables)
Constructs a runnable chain with a provided array of runnables to iterate over.
|
Modifier and Type | Method and Description |
---|---|
void |
run() |
public RunnableChain(boolean exceptionStopsChain, java.lang.Runnable... runnables)
exceptionStopsChain
- true
to allow uncaught exceptions to propagate and stop chain executionrunnables
- Runnables to execute in chainpublic RunnableChain(boolean exceptionStopsChain, java.lang.Iterable<? extends java.lang.Runnable> toRun)
Iterable
. The provided Iterable
wont be
requested for Iterable.iterator()
until execution is about to start. This can allow
a lazy decision for what runnables should be executed.exceptionStopsChain
- true
to allow uncaught exceptions to propagate and stop chain executiontoRun
- Iterable collection of runnables to run