Interface InterruptGate


public interface InterruptGate
Declares when a script has reached a safe boundary for a platform-requested break or world hop.

Scripts that override AbstractScript.interruptGate() are polled by the runtime when it produces telemetry. While safeToInterrupt() is false, Command Center keeps a pending break or hop on hold rather than pausing an indivisible interaction. A gate must reach a safe state promptly after ScriptContext.isBreakRequested() becomes true; the platform performs the actual pause.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Holder avoids allocating a new default gate for every script instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default legacy gate.
    Returns a short operator-facing reason while work is still in progress.
    boolean
    Returns whether the current script state may be paused safely.
  • Method Details

    • safeToInterrupt

      boolean safeToInterrupt()
      Returns whether the current script state may be paused safely.
      Returns:
      true only at a script-owned interruption boundary
    • holdReason

      String holdReason()
      Returns a short operator-facing reason while work is still in progress.

      The runtime uses safe-to-break whenever the gate is safe, so this value is consulted only while safeToInterrupt() is false.

      Returns:
      a stable, plain-language hold reason such as round-active
    • alwaysSafe

      static InterruptGate alwaysSafe()
      Returns the default legacy gate. It is intentionally not emitted as a deferred-interrupt policy unless a script overrides AbstractScript.interruptGate().
      Returns:
      an always-safe gate for scripts that retain immediate interrupts