Interface StepController


  • public interface StepController
    Created by Colby on 12/9/2015.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void execute​(java.util.function.Consumer<StepController> stepWork)
      If the step is long running, it should execute its work as a runnable, through this function.
      void yield()
      This function ensures that upon return, all outstanding events have been processed through the control queue.
    • Method Detail

      • execute

        void execute​(java.util.function.Consumer<StepController> stepWork)
        If the step is long running, it should execute its work as a runnable, through this function. This moves the execution off of the control thread, so that updates to state (pause, cancel, deactivate) can be delivered while work is in progress. The work function should continue to check the state periodically, and exit as soon as reasonable (according to the type of step) when the state is no longer running.

        The transition of a step to paused/cancelled/deactivated will only complete when the work in this function is complete.

      • yield

        void yield()
        This function ensures that upon return, all outstanding events have been processed through the control queue. This ensures that the step's pause/cancel/deactivate functions have been called if appropriate, allowing the step to prevent unnecessary or incorrect execution.

        Steps that run in a periodic fashion (loop, timer, etc) and that modify the scope variables should call this each iteration. This ensures that it will know not to update the scope again after the prior change triggered deactivation, for example.