From 973f324463a91721cc8a1158a5ab10ad0dd69019 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 29 Oct 2019 15:15:36 +0100 Subject: child_process,cluster: allow using V8 serialization API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an `serialization` option that allows child process IPC to use the (typically more powerful) V8 serialization API. Fixes: https://github.com/nodejs/node/issues/10965 PR-URL: https://github.com/nodejs/node/pull/30162 Reviewed-By: Colin Ihrig Reviewed-By: Gus Caplan Reviewed-By: David Carlier Reviewed-By: Michaƫl Zasso --- lib/internal/bootstrap/pre_execution.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/internal/bootstrap/pre_execution.js') diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 80ac97ee45..e58293e616 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -326,7 +326,11 @@ function setupChildProcessIpcChannel() { // Make sure it's not accidentally inherited by child processes. delete process.env.NODE_CHANNEL_FD; - require('child_process')._forkChild(fd); + const serializationMode = + process.env.NODE_CHANNEL_SERIALIZATION_MODE || 'json'; + delete process.env.NODE_CHANNEL_SERIALIZATION_MODE; + + require('child_process')._forkChild(fd, serializationMode); assert(process.send); } } -- cgit v1.2.3