@sdetweil Works as you wrote. Sadly its not in the documentation.
Read the statement by Michael Teeuw here.
Posts made by Adam 2
-
RE: Does node_helper know if all module instances are already started?
-
RE: Does node_helper know if all module instances are already started?
@sdetweil I’m searching the documentation and cannot find this global config var. How exactly can I access it?
-
RE: Does node_helper know if all module instances are already started?
@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.
-
RE: Does node_helper know if all module instances are already started?
@MMRIZE My node_helper does not interact with other modules. It interacts only with many instances of my module, because there is only one node_helper even if module has multiple instances. It looks that DOM_OBJECTS_CREATED notification is a good way to know that each module instance is already started. However, as it is received by the module, in fact each instance will pass that info to node_helper while only one is enough. However, this is not a huge issue. After this is passed to node_helper I can be sure that module instances are ready to display data through API provided by the node_helper. Moreover, I can be sure that all individual configs for each module are already loaded.
-
RE: Does node_helper know if all module instances are already started?
@sdetweil So node_helper would never know if all possible module instances are loaded. If it can be assumed that module instances are started in the order defined in config file I could set some config parameter for the first instance with number of modules that will be setup. This can be send to node_helper and then node_helper can wait until it counts proper number of started modules because each of them will notify. After that it can assume that the display is in “stable” state and it is possible to send some new data to display and know that it will be displayed for sure because proper module is already started. The drawback is that I have to count all module instances and introduce some specific config parameter for first of them.
-
RE: Does node_helper know if all module instances are already started?
@sdetweil I know that helper sends notification to all modules. However, my question is if knows that all modules are already started? Modules can send some notification after they are started but still as their number can differ node_helper cannot know if all of them are started. My only idea is to wait for first notification from first started module and then wait for for example 5s and assume that other instances have also been started.
-
Does node_helper know if all module instances are already started?
I created a module that displays some specific information. Multiple instances of it are configured. After each instance starts it sends its config to node_helper in its start function. Then node_helper is responsible to handle display and sending notifications to the instances. My question is if node_helper is aware that all module instances have been started? I would like to know when node_helper can “move” to “ready to display” state. This will be achieved after I am sure that all module instances are started and they have already sent their specific configs to node_helper script. As there may be multiple instances of module and their number may vary I cannot simply wait for a specific number of configs because this may change. Is it possible to know in node_helper that all instances are started? Of course I can wait for some time and then assume that every instance had time to start but this is not a nice solution.