use cluster.on('fork') for adding forks
This commit is contained in:
parent
14c4788e8c
commit
34b0aaf460
4
test.js
4
test.js
|
@ -11,11 +11,13 @@ if (cluster.isMaster) {
|
||||||
cstore = require('./master').create({
|
cstore = require('./master').create({
|
||||||
name: 'foo-level'
|
name: 'foo-level'
|
||||||
});
|
});
|
||||||
cstore.addWorker(cluster.fork());
|
|
||||||
cstore.then(function (db) {
|
cstore.then(function (db) {
|
||||||
db.set('foo', 'bar');
|
db.set('foo', 'bar');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cluster.fork();
|
||||||
|
cluster.fork();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue