Class PausableFutureStepWork
java.lang.Object
com.inductiveautomation.sfc.api.util.PausableFutureStepWork
- All Implemented Interfaces:
- Consumer<StepController>
A helper class to be used with StepContext.execute, takes a CompletableFuture, and will block step progression until
 the future has completed. However, the work can also be "paused", in which case the step is allowed to exit. This is
 commonly used for step pause, and then the same object is re-submitted to the StepContext upon resume.
 
Additionally, a runnable can be passed in that will be called each time the work exits (on completion, and on pause).
- 
Constructor SummaryConstructorsConstructorDescriptionPausableFutureStepWork(CompletableFuture<?> chartFuture) PausableFutureStepWork(CompletableFuture<?> chartFuture, Runnable exitTask) Blocks until the provided future is complete, unless paused.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaccept(StepController controller) voidfinish()voidpause()
- 
Constructor Details- 
PausableFutureStepWork
- 
PausableFutureStepWorkBlocks until the provided future is complete, unless paused. If exitTask is not null, each time the work exits (pause or completion), the function will be called.
 
- 
- 
Method Details- 
finishpublic void finish()
- 
pausepublic void pause()
- 
accept- Specified by:
- acceptin interface- Consumer<StepController>
 
 
-