Package com.valhalla.sdk
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 ClassesModifier and TypeInterfaceDescriptionstatic final classHolder avoids allocating a new default gate for every script instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic InterruptGateReturns the default legacy gate.Returns a short operator-facing reason while work is still in progress.booleanReturns 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:
trueonly 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-breakwhenever the gate is safe, so this value is consulted only whilesafeToInterrupt()is false.- Returns:
- a stable, plain-language hold reason such as
round-active
-
alwaysSafe
Returns the default legacy gate. It is intentionally not emitted as a deferred-interrupt policy unless a script overridesAbstractScript.interruptGate().- Returns:
- an always-safe gate for scripts that retain immediate interrupts
-