Class ExecutionRun

java.lang.Object
com.soulfiremc.server.script.ExecutionRun

public final class ExecutionRun extends Object
Per-invocation execution state. Each trigger invocation gets its own ExecutionRun so that concurrent triggers don't corrupt each other's node output sinks.
  • Constructor Details

    • ExecutionRun

      public ExecutionRun()
  • Method Details

    • awaitNodeOutputs

      public reactor.core.publisher.Mono<Map<String, NodeValue>> awaitNodeOutputs(String nodeId)
      Waits for a node to produce outputs within this run.
      Parameters:
      nodeId - the node to wait for
      Returns:
      a Mono that completes with the node's outputs
    • publishNodeOutputs

      public void publishNodeOutputs(String nodeId, Map<String, NodeValue> outputs)
      Publishes node outputs, allowing consumers to receive the latest value. Uses replay().latest() so that producers can emit multiple times (loops work) and consumers always get the most recent value.
      Parameters:
      nodeId - the node identifier
      outputs - the output values
    • incrementAndCheckLimit

      public boolean incrementAndCheckLimit()
      Increments the execution count and checks if the limit has been exceeded.
      Returns:
      true if execution is allowed, false if the limit has been exceeded