Interface StepController


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

    Modifier and Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    this parked a dedicated native thread for the work's entire active life, risking native-thread exhaustion when many steps blocked concurrently.
    void
    Registers long-running, future-backed work that should hold the step (and thus the chart's progression) until the work's backing future completes or the step is paused.
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    this was only meaningful for the parked-thread execute(Consumer) model and has no first-party callers.
  • Method Details

    • executeUntilComplete

      void executeUntilComplete(PausableFutureStepWork work)
      Registers long-running, future-backed work that should hold the step (and thus the chart's progression) until the work's backing future completes or the step is paused.

      The transition of a step to paused/cancelled/deactivated will only complete when this work has exited. Unlike the deprecated execute(Consumer), this does not park a native thread: it registers a completion callback on the work's per-episode exit signal (the one PausableFutureStepWork.rearm() returns), so a step that is merely waiting on a future holds no thread.

      Parameters:
      work - the future-backed work to wait on.
    • execute

      @Deprecated(since="8.3.8", forRemoval=true) void execute(Consumer<StepController> stepWork)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this parked a dedicated native thread for the work's entire active life, risking native-thread exhaustion when many steps blocked concurrently. Use executeUntilComplete(PausableFutureStepWork), which is callback-driven and holds no thread. The controller implementation now accepts only a PausableFutureStepWork here and throws UnsupportedOperationException for any other Consumer (since arbitrary work can no longer be run without parking a thread), so this is source/binary compatible but not behavior compatible for callers that passed a different Consumer. It has no first-party callers.
      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

      @Deprecated(since="8.3.8", forRemoval=true) void yield()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this was only meaningful for the parked-thread execute(Consumer) model and has no first-party callers. Retained for API compatibility.
      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.