This is a bad idea and an anti pattern in node world. Similar to goroutines in Go, extra processes in Node should be short lived and mostly handled in the background for extraneous tasks. It would be much better to have the plugins register themselves to an exposed init function, and go from there. Node is event based, so while I'm all ears to your approach, 95% of Node programs, even big ones, don't need to make any extra processes, manually that is.
How’s it going, I'm a Adam, a Full-Stack Engineer, actively searching for work. I'm all about JavaScript. And Frontend but don't let that fool you - I've also got some serious Backend skills.
Location
City of Bath, UK 🇬🇧
Education
10 plus years* active enterprise development experience and a Fine art degree 🎨
This is a bad idea and an anti pattern in node world. Similar to goroutines in Go, extra processes in Node should be short lived and mostly handled in the background for extraneous tasks. It would be much better to have the plugins register themselves to an exposed init function, and go from there. Node is event based, so while I'm all ears to your approach, 95% of Node programs, even big ones, don't need to make any extra processes, manually that is.
Since we are talking hypothetically anyway, I appreciate your ears haha, here is what I'm trying to achieve.
Goals:
I'm agile, I'm not doing it all at once, just laying some foundations.
By default all my plugin processes are suspended at startup, they will be short lived switching States as required.
Your refering to workers and fork when you say "not manually"?
Is my idea overkill?
How then could I pause plugins from running. Could a generator function toggle on and off.
Ps, I know very little about go.