I personally feel this kind of functionality should be special outside of the node-core binary, but still be part of the node package.
I propose a node-app (or similar named) binary, that wraps node and provides the extra functionality such as cluster, and leaving room for future expansion into configuring "apps" of node instead of libraries, before we go down the road of node --foo --bar --baz --cluster-main myApp.js --cluster-workers worker.js
I propose we continue to expand on package.json, and have a binary you pass a config file to to load.
and windows would be "C:\node\node-app.exe C:\MyApp\MyApp.json"
And ideally, would CWD into the dir of the .json file for execution, and let the .json file specify a different CWD relative (using path.resolve based off CWD of .json) to the .json file.
and if node-app is invoked without a first arg, it looks for package.json (or maybe a diff filename if you guys feel is more appropriate) in current directory
> I personally feel this kind of functionality should be special outside of > the node-core binary, but still be part of the node package.
> I propose a node-app (or similar named) binary, that wraps node and > provides the extra functionality such as cluster, and leaving room for > future expansion into configuring "apps" of node instead of libraries, > before we go down the road of node --foo --bar --baz --cluster-main myApp.js > --cluster-workers worker.js
> I propose we continue to expand on package.json, and have a binary you pass > a config file to to load.
On Mon, Oct 17, 2011 at 1:01 PM, Aikar <ai...@aikar.co> wrote: > Per: https://github.com/joyent/node/pull/1879#issuecomment-2424882 > Some concerns have been raised about the new cluster functionality built > into core. > I personally feel this kind of functionality should be special outside of > the node-core binary, but still be part of the node package. > I propose a node-app (or similar named) binary, that wraps node and provides > the extra functionality such as cluster, and leaving room for future > expansion into configuring "apps" of node instead of libraries, before we go > down the road of node --foo --bar --baz --cluster-main myApp.js > --cluster-workers worker.js > I propose we continue to expand on package.json, and have a binary you pass > a config file to to load. > For example: > ./myapp
> Under this idea, node binary would continue to serve as a single VM, and the > node-app binary would be where all "core approved" magic would live. > What do you guys think?
You wouldn't consider configuring advanced features such as cluster in a JSON file simpler than appending magical keywords onto the binary?
Having a standardized ways of developing/configuring apps from node-core in an already established JSON file method Id think would be ideal..
What happens when you guys consider another feature 'core worthy', so we make a munged special keyword that does both?
I'm just really afraid of putting keywords into the arguments (and before the filename at that, hurting shebang simplicity) is going to limit future progression of node.
On Tue, Oct 18, 2011 at 2:55 PM, Aikar <ai...@aikar.co> wrote: > You wouldn't consider configuring advanced features such as cluster in a > JSON file simpler than appending magical keywords onto the binary?
No.
> Having a standardized ways of developing/configuring apps from node-core in > an already established JSON file method Id think would be ideal.. > What happens when you guys consider another feature 'core worthy', so we > make a munged special keyword that does both? > I'm just really afraid of putting keywords into the arguments (and before > the filename at that, hurting shebang simplicity) is going to limit future > progression of node.
On Tue, Oct 18, 2011 at 15:20, Ryan Dahl <r...@tinyclouds.org> wrote: >> I'm just really afraid of putting keywords into the arguments (and before >> the filename at that, hurting shebang simplicity) is going to limit future >> progression of node.
How does that hurt shebangs?
#!/usr/bin/env node cluster // runs in node cluster mode
I disagree that it hurts shebangs, but it does hurt app-level configurability.
In Haraka for example I have nodes=N|cpus in a config file. If it is there (and not zero) it runs "clustered" (I hate that term, but it is familiar for now).
That's now really hard to do. You can't do it from within node any more.
On Tue, Oct 18, 2011 at 6:29 PM, Isaac Schlueter <i...@izs.me> wrote: > On Tue, Oct 18, 2011 at 15:20, Ryan Dahl <r...@tinyclouds.org> wrote: > >> I'm just really afraid of putting keywords into the arguments (and > before > >> the filename at that, hurting shebang simplicity) is going to limit > future > >> progression of node.
If you have an webserver - probably you have an configuration file, its how things used to be. It will be bad if node-cluster configuration and application config will be in the different places, so the solution is the default config provided by the node cluster and accessible from the application.
On 19 October 2011 06:42, Matt <hel...@gmail.com> wrote:
> I disagree that it hurts shebangs, but it does hurt app-level > configurability.
> In Haraka for example I have nodes=N|cpus in a config file. If it is there > (and not zero) it runs "clustered" (I hate that term, but it is familiar for > now).
> That's now really hard to do. You can't do it from within node any more.
> Matt.
> On Tue, Oct 18, 2011 at 6:29 PM, Isaac Schlueter <i...@izs.me> wrote:
>> On Tue, Oct 18, 2011 at 15:20, Ryan Dahl <r...@tinyclouds.org> wrote: >> >> I'm just really afraid of putting keywords into the arguments (and >> before >> >> the filename at that, hurting shebang simplicity) is going to limit >> future >> >> progression of node.