Permalink
Browse files

rebranding as cluster

  • Loading branch information...
1 parent ad99a1c commit 2136fbfd5d07eca9a1d164259ec3b8f1f572dfab @tj tj committed Feb 11, 2011
View
@@ -1,19 +1,19 @@
## API
- The Engine API at its core is extremely simple, all we need to do is pass
- our http `server` to `engine()`, then call `listen()` as we would on the `http.Server` itself.
+ The Cluster API at its core is extremely simple, all we need to do is pass
+ our http `server` to `cluster()`, then call `listen()` as we would on the `http.Server` itself.
- var engine = require('../')
+ var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
res.writeHead(200);
res.end('Hello World');
});
- engine(server)
+ cluster(server)
.listen(3000);
### Plugins
@@ -28,14 +28,14 @@
To use them, all we need to do is pass it to the `use()` method:
- engine(server)
+ cluster(server)
.use(myPlugin('/some/path'))
.listen(3000);
- To use a plugin that is bundled with Engine simply grab it from the `engine` object:
+ To use a plugin that is bundled with Cluster simply grab it from the `cluster` object:
- engine(server)
- .use(engine.logger())
+ cluster(server)
+ .use(cluster.logger())
.listen(3000);
### Settings
@@ -49,14 +49,14 @@
We can take what we have now, and go on to apply settings using the `set(option, value)` method. For example:
- engine(server)
+ cluster(server)
.set('working directory', '/')
.set('workers', 5)
.listen(3000);
### Signals
- Engine performs the following actions when handling signals:
+ Cluster performs the following actions when handling signals:
- `SIGINT` hard shutdown
- `SIGTERM` hard shutdown
View
@@ -22,6 +22,6 @@ Outputs verbose debugging information to _stderr_.
## Usage
- engine(server)
- .use(engine.debug())
+ cluster(server)
+ .use(cluster.debug())
.listen(3000);
View
@@ -16,20 +16,20 @@ The `logger([path[, level]])` plugin accepts an optional `path`, and optional `l
Outputting to `./logs`:
- engine(server)
- .use(engine.logger())
+ cluster(server)
+ .use(cluster.logger())
.listen(3000);
Outputting to `./tmp/logs`:
- engine(server)
- .use(engine.logger('tmp/logs'))
+ cluster(server)
+ .use(cluster.logger('tmp/logs'))
.listen(3000);
Outputting to `/var/log/node` with a log level of `debug`:
- engine(server)
- .use(engine.logger('/var/log/node', 'debug'))
+ cluster(server)
+ .use(cluster.logger('/var/log/node', 'debug'))
.listen(3000);
View
@@ -15,12 +15,12 @@ The `pidfiles([path])` plugin saves pid (process-id) files to the given `path` o
save to `./pids`:
- engine(server)
- .use(engine.pidfiles())
+ cluster(server)
+ .use(cluster.pidfiles())
.listen(3000);
save to `/var/run/node`:
- engine(server)
- .use(engine.logger('/var/run/node'))
+ cluster(server)
+ .use(cluster.logger('/var/run/node'))
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var body = 'Hello World'
@@ -13,6 +13,6 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
+cluster(server)
.set('working directory', '/')
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -13,7 +13,7 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
- .use(engine.logger('logs', 'debug'))
- .use(engine.debug())
+cluster(server)
+ .use(cluster.logger('logs', 'debug'))
+ .use(cluster.debug())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -14,9 +14,9 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
- .use(engine.debug())
- .use(engine.logger())
- .use(engine.stats())
- .use(engine.repl(__dirname + '/repl'))
+cluster(server)
+ .use(cluster.debug())
+ .use(cluster.logger())
+ .use(cluster.stats())
+ .use(cluster.repl(__dirname + '/repl'))
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -13,6 +13,6 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
- .use(engine.logger())
+cluster(server)
+ .use(cluster.logger())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var body = 'Hello World'
@@ -13,6 +13,6 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
- .use(engine.pidfiles())
+cluster(server)
+ .use(cluster.pidfiles())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
// try loading, and changing "Hello", to "Hello World"
@@ -15,8 +15,8 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
+cluster(server)
.set('workers', 1)
- .use(engine.reload(__dirname))
- .use(engine.debug())
+ .use(cluster.reload(__dirname))
+ .use(cluster.debug())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -15,14 +15,14 @@ var server = http.createServer(function(req, res){
// custom repl function
-engine.repl.define('echo', function(master, sock, msg){
+cluster.repl.define('echo', function(master, sock, msg){
sock.write(msg + '\n');
}, 'echo the given message');
// $ telnet /path/to/examples/repl
-engine(server)
+cluster(server)
.set('workers', 1)
- .use(engine.logger())
- .use(engine.repl(__dirname + '/repl'))
+ .use(cluster.logger())
+ .use(cluster.repl(__dirname + '/repl'))
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -15,15 +15,15 @@ var server = http.createServer(function(req, res){
// custom repl function
-engine.repl.define('echo', function(master, sock, msg){
+cluster.repl.define('echo', function(master, sock, msg){
sock.write(msg + '\n');
}, 'echo the given message');
// $ telnet localhots 8888
-engine(server)
- .use(engine.logger('logs'))
- .use(engine.stats())
- .use(engine.repl(8888))
- .use(engine.debug())
+cluster(server)
+ .use(cluster.logger('logs'))
+ .use(cluster.stats())
+ .use(cluster.repl(8888))
+ .use(cluster.debug())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var body = 'Hello World'
@@ -13,7 +13,7 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
+cluster(server)
.set('working directory', '/')
.set('workers', 1)
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var server = http.createServer(function(req, res){
@@ -13,6 +13,6 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
- .use(engine.stats())
+cluster(server)
+ .use(cluster.stats())
.listen(3000);
View
@@ -3,7 +3,7 @@
* Module dependencies.
*/
-var engine = require('../')
+var cluster = require('../')
, http = require('http');
var body = 'Hello World'
@@ -13,6 +13,6 @@ var server = http.createServer(function(req, res){
res.end(body);
});
-engine(server)
+cluster(server)
.set('working directory', '/')
.listen('/tmp/server.sock');
View
@@ -1,2 +1,2 @@
-module.exports = require('./lib/engine');
+module.exports = require('./lib/cluster');
@@ -1,6 +1,6 @@
/*!
- * Engine
+ * Cluster
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
View
@@ -1,7 +1,6 @@
-
/*!
- * Engine - Master
+ * Cluster - Master
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
View
@@ -1,6 +1,6 @@
/*!
- * Engine - receiver mixin
+ * Cluster - receiver mixin
* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
View
@@ -1,6 +1,6 @@
/*!
- * Engine - debug
+ * Cluster - debug
* Copyright (c) 2010 LearnBoost <dev@learnboost.com>
* MIT Licensed
*/
Oops, something went wrong.

0 comments on commit 2136fbf

Please sign in to comment.