LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

cluster with node 0.5+ #166

Closed defunctzombie closed 12 years ago

defunctzombie commented 12 years ago

Given that node 0.5.11+ will have a new cluster module built in, how can one continue to use this module?

require('cluster'); won't do the right thing anymore iirc.

tj commented 12 years ago

nope you're correct, require('cluster') will always select the core one :( Ryan mentioned they could change the name of the one in core, however if the core 'cluster' is done properly there would be little reason to use learnboost/cluster anymore, we can break the plugins into separate modules that you would just require() like normal.

there are certainly some issues with that since it's pretty opinionated stuff in core, learnboost/cluster's plugin functionality will no doubt never exist in node core, at least not the same. so it's a tough call, im not sure right now what will end up being the right way to go.

defunctzombie commented 12 years ago

Sigh. Why did it go into core in the first place? Why not just expose the system calls needed to create the modules and then promote the right 3rd party libraries? Putting it in core just means polluting the namespace that much more. /rant

tj commented 12 years ago

yeah i think that's the goal kinda, just expose enough of a core library to make it extensible. it keeps changing often so i havent looked into it but it should be possible to keep cluster's api as-is if they change the internal name to something else

TooTallNate commented 12 years ago

It sucks since we'll have to rename this lib or something (assuming they don't rename the core one). But you can avoid requiring the core cluster by doing a relative require: require('./node_modules/cluster'). Not a pretty solution obviously...

tj commented 12 years ago

i know ryan was open to naming the core lib something else, not sure what else you could name it though without getting really corny

wadey commented 12 years ago

Looks like they kept the name "cluster" for core, so this module should probably be renamed so that we can port stuff to node 0.6. Maybe "learnboost-cluster"? or something more clever?

CoderPuppy commented 12 years ago

I'm just getting the source and changing the name in package.json