public class ElaraLoop extends Loop
Loop allowing for an initialisation step executed in the elera thread before the loop.
The static start(..)
method takes the RunnerFactory and initialises most elara objects on the target thread.| Constructor and Description |
|---|
ElaraLoop(LoopCondition loopCondition,
IdleStrategy idleStrategy,
ExceptionHandler exceptionHandler,
Runnable initStep,
Step... steps)
Constructor with loop condition, idle strategy, step exception handler and the steps to perform.
|
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
static StoppableThread |
start(IdleStrategy idleStrategy,
ExceptionHandler exceptionHandler,
ThreadFactory threadFactory,
RunnerFactory runnerFactory)
Creates, starts and returns a new thread running a loop with the given steps.
|
mainLoop, shutdownLoop, start, startpublic ElaraLoop(LoopCondition loopCondition, IdleStrategy idleStrategy, ExceptionHandler exceptionHandler, Runnable initStep, Step... steps)
loopCondition - the condition defining when the loop terminatesidleStrategy - the idle strategy defining how to handle situations without work to doexceptionHandler - the handler for step exceptionsinitStep - initialisation step run once before running the loopsteps - the steps executed in the looppublic static StoppableThread start(IdleStrategy idleStrategy, ExceptionHandler exceptionHandler, ThreadFactory threadFactory, RunnerFactory runnerFactory)
idleStrategy - the strategy handling idle loop phasesexceptionHandler - the step exception handlerthreadFactory - the factory to provide the service threadrunnerFactory - factory to create the objects to run on the elara threadCopyright © 2020 tools4j.org (Marco Terzer, Anton Anufriev). All Rights Reserved.