Skip to content

ForkedProcess

Defined in: packages/node/src/process/fork-process.ts:59

A forked Node module: everything a SpawnedProcess offers, plus the IPC channel fork opens.

new ForkedProcess(child, startedAt, options?): ForkedProcess

Defined in: packages/node/src/process/fork-process.ts:60

ChildProcess

number

SpawnedProcessOptions

ForkedProcess

SpawnedProcess.constructor

get pid(): number | undefined

Defined in: packages/node/src/process/spawned-process.ts:85

number | undefined

SpawnedProcess.pid


get stderr(): ReadableStream<Uint8Array<ArrayBufferLike>> | null

Defined in: packages/node/src/process/spawned-process.ts:96

The child’s standard error, null unless it was piped.

ReadableStream<Uint8Array<ArrayBufferLike>> | null

SpawnedProcess.stderr


get stdout(): ReadableStream<Uint8Array<ArrayBufferLike>> | null

Defined in: packages/node/src/process/spawned-process.ts:90

The child’s standard output, null unless it was piped.

ReadableStream<Uint8Array<ArrayBufferLike>> | null

SpawnedProcess.stdout

[asyncDispose](): Promise<void>

Defined in: packages/node/src/process/spawned-process.ts:189

Promise<void>

SpawnedProcess.[asyncDispose]


isSubscribed<K>(event, listener): boolean

Defined in: packages/async/src/events/event-dispatcher-map-base.ts:38

Check if a callback is subscribed to a specific event.

K extends "message" | "output"

K

The event name.

Callable<ForkedProcessEvents[K]>

The callback to check.

boolean

SpawnedProcess.isSubscribed


kill(signal?): boolean

Defined in: packages/node/src/process/spawned-process.ts:185

Sends one signal and returns, with no escalation — for signals that mean something to the child other than “shut down”.

Signals = "SIGTERM"

Defaults to SIGTERM.

boolean

Whether the signal was delivered.

SpawnedProcess.kill


send(message, signal?): Promise<void>

Defined in: packages/node/src/process/fork-process.ts:80

Sends a message to the child.

Serializable

Anything the configured serialization can carry.

AbortSignal | null

Abandons the send.

Promise<void>

A promise resolving once the message has been handed to the OS.


subscribe<K>(event, listener, options?): Callable | null

Defined in: packages/node/src/process/spawned-process.ts:111

K extends "message" | "output"

K

Callable<ForkedProcessEvents[K]>

EventDispatcherSubscribeOptions

Callable | null

SpawnedProcess.subscribe


terminate(graceMs?): Promise<ProcessExit>

Defined in: packages/node/src/process/spawned-process.ts:160

Sends SIGTERM, then SIGKILL if the child is still alive after graceMs. Idempotent: concurrent and repeated calls share one escalation.

number

Overrides the grace period given at spawn time.

Promise<ProcessExit>

The child’s exit, once it has happened.

SpawnedProcess.terminate


unsubscribe<K>(event, listener): void

Defined in: packages/async/src/events/event-dispatcher-map-base.ts:31

Unsubscribe a callback from a specific event.

K extends "message" | "output"

K

The event name.

Callable<ForkedProcessEvents[K]>

The callback to remove.

void

SpawnedProcess.unsubscribe


wait<K>(event, options?): Promise<ForkedProcessEvents[K]>

Defined in: packages/node/src/process/spawned-process.ts:120

K extends "message" | "output"

K

EventDispatcherWaitOptions<ForkedProcessEvents[K]>

Promise<ForkedProcessEvents[K]>

SpawnedProcess.wait


waitForExit(signal?): Promise<ProcessExit>

Defined in: packages/node/src/process/spawned-process.ts:134

Resolves once the child has exited, immediately if it already has.

AbortSignal | null

Abandons the wait; the child is left running.

Promise<ProcessExit>

The exit code, terminating signal and wall-clock duration.

SpawnedProcess.waitForExit