rescript-nodejs icon indicating copy to clipboard operation
rescript-nodejs copied to clipboard

How to use childprocess.send and process.on("message")?

Open daysv opened this issue 1 year ago • 1 comments

How to use childprocess.send and process.on("message")?

main

const child = fork('xxx')
child.send("hi")

child

process.on("message', () => {})

daysv avatar May 23 '24 02:05 daysv

fork has a binding: https://github.com/TheSpyder/rescript-nodejs/blob/2f937007a548576afb95226595f7d6e67363aada/src/ChildProcess.res#L129-L130

But I can't find one for send. Likewise there are a few on bindings, but nothing for on("message"). https://github.com/TheSpyder/rescript-nodejs/blob/2f937007a548576afb95226595f7d6e67363aada/src/ChildProcess.res#L9-L18

So both need to be added.

TheSpyder avatar May 24 '24 03:05 TheSpyder