Add NAN_MODULE_WORKER_ENABLED macro as a replacement for NAN_MODULE that supports multiple workers #792
Conversation
…hat supports multiple workers Uses the named symbol node_register_module_v## variant of registration that works on node 10.5 with --experimental-workers. May need updating in the future if node requires native modules to explicitly opt in to multiple isolate support.
#if NODE_MAJOR_VERSION >= 10 || \ | ||
NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 | ||
#define NAN_CONCAT(a, b) NAN_CONCAT_HELPER(a, b) | ||
#define NAN_CONCAT_HELPER(a, b) a##b |
kkoopa
Jul 1, 2018
Collaborator
I would prefer these two to be defined regardless of the Node version, since they effectively become public.
I would prefer these two to be defined regardless of the Node version, since they effectively become public.
…ck so that it's consistently declared
Thank you. |
Uses the named symbol
node_register_module_v##
variant of registration that works to support loading in multiple workers on node 10.5 with--experimental-workers
.This may need updating in the future if/when node requires native modules to explicitly opt in to multiple isolate support.