You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you run nsm app.js more than once, nsolid-manager will try to launch new instances of all the nsolid apps and dependencies listening on the same ports. This leads to some strange and broken behavior between the two nsm instances. It should be a high priority to clean-up this issue. There are two ways that we can solve this problem:
Piggybacking
In this solution, nsm instance 1 starts all dependencies, and sets a global flag in the package that indicates an instance is already running. When nsm instance 2 is started it checks for that flag and doesn't try to start any dependencies. This will cause nsm instance 2 to use the dependencies being run by nsm instance 1.
Pros:
Easy to implement
Cons:
nsm instance 2 won't receive any console output
nsm instance 2 won't know when the proc running the dependencies is closed.
Central Service
This solution is a little more sophisticated and little more theoretical. When any nsm instance is started, it will check for an existing dependency service. If one doesn't exist it will spawn all the dependencies in a separate. It will then detach that process so it is an independent process. If a second nsm instance is started, it will check for the existing dependency service, find it, and attach itself to it. When each nsm instance is closed it will check to see if it is the only nsm instance using the service, and it if it is, it will shut down the service
Pros:
Scalable for n nsm instances
Less opportunity for nsm instances to collide and interfere with each other
Cons:
More difficult to implement
Not sure if it is practically possible for processes to detach/reattach themselves.
The text was updated successfully, but these errors were encountered:
Currently, if you run
nsm app.js
more than once,nsolid-manager
will try to launch new instances of all the nsolid apps and dependencies listening on the same ports. This leads to some strange and broken behavior between the two nsm instances. It should be a high priority to clean-up this issue. There are two ways that we can solve this problem:Piggybacking
In this solution,
nsm instance 1
starts all dependencies, and sets a global flag in the package that indicates an instance is already running. Whennsm instance 2
is started it checks for that flag and doesn't try to start any dependencies. This will causensm instance 2
to use the dependencies being run bynsm instance 1
.Pros:
Cons:
nsm instance 2
won't receive any console outputnsm instance 2
won't know when the proc running the dependencies is closed.Central Service
This solution is a little more sophisticated and little more theoretical. When any nsm instance is started, it will check for an existing dependency service. If one doesn't exist it will spawn all the dependencies in a separate. It will then detach that process so it is an independent process. If a second nsm instance is started, it will check for the existing dependency service, find it, and attach itself to it. When each nsm instance is closed it will check to see if it is the only nsm instance using the service, and it if it is, it will shut down the service
Pros:
Cons:
The text was updated successfully, but these errors were encountered: