Read the statement by Michael Teeuw here.
Does node_helper know if all module instances are already started?
-
@Adam-2
You can assign and deliver someinstanceID
to distinguish which instance of your module transfers this notification.
Or you can usePromise.race()
(to confirm first socketNotification coming from any instance) orPromise.allSettled()
(to confirm entire socketNotifications delivered from all instances even though fail or not) in node_helper to check socketNotifications receiving. (Anyway, you need to check how many instances there exist before promise racing) -
@MMRIZE and config. is accessible in node_helper, so one could count the module instances
-
@sdetweil Is config file accessible from the node_helper? I thought that only core module files can access it and have to send it back to node_helper if needed.
-
@Adam-2 see the global config var in the node_helper
its EVERYTHING in config.js
-
@sdetweil I’m searching the documentation and cannot find this global config var. How exactly can I access it?
-
-
@sdetweil Works as you wrote. Sadly its not in the documentation.