Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use serialization option for child process communication #2298

Closed
sindresorhus opened this issue Nov 22, 2019 · 3 comments
Closed

Use serialization option for child process communication #2298

sindresorhus opened this issue Nov 22, 2019 · 3 comments
Labels
future we'll get back to this eventually low priority scope:internals

Comments

@sindresorhus
Copy link
Member

sindresorhus commented Nov 22, 2019

childProcess.fork received a new option called serialization, which would let us use the V8 clone algorithm for passing messages instead of JSON. We could then pass types like Buffer.

It was added in Node.js 13.2.0, so we cannot use this until we target Node.js 14.

https://nodejs.org/en/blog/release/v13.2.0/
https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options

@sindresorhus sindresorhus added low priority future we'll get back to this eventually scope:internals labels Nov 22, 2019
@novemberborn novemberborn self-assigned this May 25, 2020
@novemberborn
Copy link
Member

It's available in Node.js 12.16 now. There's a commit in #2478 which achieves this.

@novemberborn
Copy link
Member

FWIW this requires nodejs/node#34797 which I think may have been introduced in 16.4.2, but has not been backported to 14 or 12.

@novemberborn novemberborn removed their assignment Jul 5, 2021
@novemberborn
Copy link
Member

Done in #3184.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future we'll get back to this eventually low priority scope:internals
Projects
None yet
Development

No branches or pull requests

2 participants