Summary
child_process.fork(modulePath[, args][, options]) is not implemented. fork spawns a child running a Node module with an IPC channel wired up, exposing child.send(msg), child.on("message", …), child.disconnect(), and the connected/channel state.
This is the largest remaining piece of #1780. It depends on real async subprocess execution + an IPC channel (see the async-reactor issue), which Perry does not have today — every child currently runs synchronously to completion, so there is no live process to exchange messages with.
What to do
- Implement
fork() returning a ChildProcess with a working IPC channel.
child.send(message[, sendHandle][, options][, callback]) serializes message (JSON / advanced serialization) to the child.
child.on("message", (msg) => …) fires when the child calls process.send(...).
child.disconnect() closes the channel; connected flips to false, channel to null.
- The child side needs
process.send / process.on("message") / process.connected / process.disconnect().
Note: in compiled-Perry there is no node to fork into — fork of a .ts/.js module path implies either re-spawning the compiled Perry binary with an entry selector, or compiling the forked module too. Scope the child-launch strategy as part of this ticket.
Parent: #1780. perry 0.5.1029.
Summary
child_process.fork(modulePath[, args][, options])is not implemented.forkspawns a child running a Node module with an IPC channel wired up, exposingchild.send(msg),child.on("message", …),child.disconnect(), and theconnected/channelstate.This is the largest remaining piece of #1780. It depends on real async subprocess execution + an IPC channel (see the async-reactor issue), which Perry does not have today — every child currently runs synchronously to completion, so there is no live process to exchange messages with.
What to do
fork()returning aChildProcesswith a working IPC channel.child.send(message[, sendHandle][, options][, callback])serializesmessage(JSON / advanced serialization) to the child.child.on("message", (msg) => …)fires when the child callsprocess.send(...).child.disconnect()closes the channel;connectedflips tofalse,channeltonull.process.send/process.on("message")/process.connected/process.disconnect().Note: in compiled-Perry there is no
nodeto fork into —forkof a.ts/.jsmodule path implies either re-spawning the compiled Perry binary with an entry selector, or compiling the forked module too. Scope the child-launch strategy as part of this ticket.Parent: #1780. perry 0.5.1029.