Class: NodeRunnerDriver
Defined in: node/src/executors/node-runner-driver.ts:12
Runtime concurrency limiter implementing RunnerDriver for NodeRunnerNode (local.runner).
Maintains independent PQueue concurrency pools for one-shot subprocess slots (withSlot, bounded by slots) and long-lived background daemon sessions (withDaemonSlot, bounded by maxDaemons) so active daemons never starve one-shot build or test commands.
Implements
Constructors
Constructor
new NodeRunnerDriver(node): NodeRunnerDriver;Defined in: node/src/executors/node-runner-driver.ts:33
Initializes a NodeRunnerDriver from a compiled NodeRunnerNode.
Sets the pool identifier and initializes independent PQueue instances for slots and maxDaemons.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | NodeRunnerNode | Passive runner pool AST node. |
Returns
NodeRunnerDriver
Methods
withDaemonSlot()
withDaemonSlot<T>(fn, signal?): Promise<T>;Defined in: node/src/executors/node-runner-driver.ts:82
Acquires a long-lived background daemon slot until releaseDaemonSlot() is invoked.
Holds a concurrency slot in this.daemonQueue across the lifetime of the ServiceSession and automatically releases the slot if the startup callback fn throws before returning.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Return value type of fn. |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (releaseDaemonSlot) => Promise<T> | Daemon startup callback receiving the release handle. |
signal? | AbortSignal | Optional abort signal cancelling daemon slot acquisition. |
Returns
Promise<T>
Result produced by fn().
Throws
If signal aborts while queued or fn() rejects.
Implementation of
withSlot()
withSlot<T>(fn, signal?): Promise<T>;Defined in: node/src/executors/node-runner-driver.ts:57
Acquires a one-shot command execution slot for the duration of fn().
Queues the caller in this.slotQueue when all slots are occupied, cancels queued waits immediately if signal aborts, detaches the wait-abort listener once dequeued so in-flight cleanup holds the slot until fn() settles, and releases the slot in finally.
Type Parameters
| Type Parameter | Description |
|---|---|
T | Return value type of fn. |
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | () => Promise<T> | Asynchronous callback executed while holding the slot. |
signal? | AbortSignal | Optional abort signal cancelling slot acquisition or execution. |
Returns
Promise<T>
Result produced by fn().
Throws
If signal aborts while queued or fn() rejects.
Implementation of
Properties
id
readonly id: string;Defined in: node/src/executors/node-runner-driver.ts:14
Logical identifier of the runner pool.
Implementation of
maxDaemons
readonly maxDaemons: number;Defined in: node/src/executors/node-runner-driver.ts:18
Maximum concurrent background daemon sessions.
slots
readonly slots: number;Defined in: node/src/executors/node-runner-driver.ts:16
Maximum concurrent one-shot command executions.