ParallelLane

class ParallelLane(val name: String) : ExecLane

Off-tick execution lane. Unlike the heartbeat-pumped tick lanes (Lane), which serialize every eval through one pump on one game thread under the 1s TimeoutGuard, this runs each eval CONCURRENTLY on its own worker thread — no tick affinity, no cross-tick yield, no scriptguard. For work that must NOT touch live game state under a tick thread's identity: pure computation, blocking I/O, anything that would freeze a tick or trip the watchdog. Always isReady (there is no heartbeat to observe).

Reuses EvalTask verbatim — the only difference from a tick lane is the DRIVER of EvalTask.pumpStep: a tick lane's heartbeat steps it once per RETURN; here a worker thread drives it to completion in a tight loop (a yield() in the snippet resumes immediately — there is no tick boundary to wait for).

Nothing reaps this lane: with no heartbeat there is no boundary past which an eval could be stranded. The stop signals are per-request EvalHandle.cancel, an authorization revoke (killAll, pushed from ClientAuthProbe), and JVM exit (daemon threads, so shutdown never waits). Each lands one interrupt(); nudgeAll is the best-effort retry behind them.

Constructors

Link copied to clipboard
constructor(name: String)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val isReady: Boolean
Link copied to clipboard

In-flight evals. The worker's own finally is the only site that removes one, so presence here means "that thread has not unwound yet".

Link copied to clipboard
open override val name: String

Functions

Link copied to clipboard
private fun drive(t: EvalTask)

Run the compiled eval to completion on ONE dedicated daemon thread, draining any cross-tick iterator in a tight loop. Mirrors Lane.pump's per-task completion contract.

Link copied to clipboard
fun killAll(reason: String): Long

Kill every in-flight eval on this lane. PUSHED from ClientAuthProbe.observe — on every client tick the gate reads denied — rather than polled by the eval itself: this lane bakes in no scriptguard, and a snippet that never yields runs to completion inside ONE EvalTask.pumpStep, so there may be no boundary at which the eval could ever notice a revoke.

Link copied to clipboard
private fun nudgeAll()

One retry pass. Nothing may escape: scheduleWithFixedDelay SILENTLY cancels the whole schedule on the first throwable.

Link copied to clipboard
open override fun submit(code: String, beforeStart: (EvalHandle) -> Unit): EvalHandle

beforeStart gets the handle after it's built but before the eval starts — where the caller registers it for cancellation, so no running eval is ever unregistered.