Skip to content
This repository was archived by the owner on Jan 6, 2021. It is now read-only.

Commit c87f72f

Browse files
committed
Merge branch 'develop' of github.com:turbonetix/bus.io into develop
2 parents 44b2496 + 5755e74 commit c87f72f

4 files changed

Lines changed: 14 additions & 23 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Build Status](https://travis-ci.org/turbonetix/bus.io.svg?branch=master)](https://travis-ci.org/turbonetix/bus.io)
22
[![NPM version](https://badge.fury.io/js/bus.io.svg)](http://badge.fury.io/js/bus.io)
3-
[![David DM](https://david-dm.org/turbonetix/bus.io.png)](https://david-dm.org/turbonetix/bus.io.png)
3+
[![David DM](https://david-dm.org/turbonetix/bus.io.png)](https://david-dm.org/turbonetix/bus.io)
44

55
![Bus.IO](https://raw.github.com/turbonetix/bus.io/master/logo.png)
66

demo/chat/app.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
* Use Cluster to fork this process, each process is an app instance.
3-
*/
4-
5-
var cluster = require('cluster'), cpus = require('os').cpus().length;
6-
7-
if (cluster.isMaster) {
8-
for (var i=0; i<cpus; i++) {
9-
cluster.fork();
10-
}
11-
cluster.on('exit', function () {
12-
cluster.fork();
13-
});
14-
return;
15-
}
16-
171
/*
182
* We are a child process now
193
*/
@@ -36,7 +20,7 @@ app.use(express.static(__dirname + '/public/'));
3620
* Create a Server to attach our Express app
3721
*/
3822

39-
var server = require('http').Server(app).listen(process.env.PORT || 3000);
23+
var server = require('http').Server(app);
4024

4125
/*
4226
* Get a Bus and using our Server
@@ -145,3 +129,9 @@ bus.out('set name', function (msg, sock, next) {
145129
}
146130
next();
147131
});
132+
133+
/*
134+
* Use sticky-session which will help us out with our process clustering
135+
*/
136+
137+
require('sticky-session')(server).listen(process.env.PORT || 3000);

demo/chat/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"express-session": "^1.2.1",
1414
"bus.io": "*",
1515
"bus.io-session": "*",
16-
"debug": "^1.0.4"
16+
"debug": "^1.0.4",
17+
"sticky-session": "^0.1.0"
1718
}
1819
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bus.io",
3-
"version": "0.6.0",
3+
"version": "0.7.0",
44
"description": "An express inspired, event-driven framework for building real time distributed applications over socket.io and redis.",
55
"main": "index.js",
66
"scripts": {
@@ -42,10 +42,10 @@
4242
"dependencies": {
4343
"bus.io-client": "^0.2",
4444
"bus.io-common": "^0.2",
45-
"bus.io-exchange": "^0.3",
45+
"bus.io-exchange": "^0.4",
4646
"bus.io-messages": "^0.2",
47-
"bus.io-receiver": "^0.1.3",
48-
"debug": "~1.0.2",
47+
"bus.io-receiver": "^0.1.5",
48+
"debug": "~2",
4949
"socket.io": "^1.0.2"
5050
},
5151
"devDependencies": {

0 commit comments

Comments
 (0)