@@ -99,18 +99,18 @@ It is recommended that you use Node.js version >=0.10.22 due to memory leaks pre
99
99
## How to use
100
100
101
101
The following example launches SocketCluster as 7 distinct processes (in addition to the current master process):
102
- - 3 workers on ports 9100, 9101, 9102
103
- - 3 stores on ports 9001, 9002, 9003
102
+ - 3 workers
103
+ - 3 stores
104
104
- 1 load balancer on port 8000 which distributes requests evenly between the 3 workers
105
105
106
106
``` js
107
107
var SocketCluster = require (' socketcluster' ).SocketCluster ;
108
108
109
109
var socketCluster = new SocketCluster ({
110
- workers: [9100 , 9101 , 9102 ],
111
- stores: [9001 , 9002 , 9003 ],
112
- balancerCount: 1 , // Optional
113
110
port: 8000 ,
111
+ balancers: 1 ,
112
+ workers: 3 ,
113
+ stores: 3 ,
114
114
appName: ' myapp' ,
115
115
workerController: ' worker.js' ,
116
116
// balancerController: 'firewall.js', // Optional
@@ -280,9 +280,9 @@ provide your private key and certificate as a start option when you instantiate
280
280
281
281
``` js
282
282
var socketCluster = new SocketCluster ({
283
- workers : [ 9100 , 9101 , 9102 ] ,
284
- stores : [ 9001 , 9002 , 9003 ] ,
285
- balancerCount : 1 , // Optional
283
+ balancers : 1 ,
284
+ workers : 3 ,
285
+ stores : 3 ,
286
286
port: 8000 ,
287
287
appName: ' myapp' ,
288
288
workerController: ' worker.js' ,
@@ -380,8 +380,8 @@ Creates a new SocketCluster, must be invoked with the new keyword.
380
380
var SocketCluster = require (' socketcluster' ).SocketCluster ;
381
381
382
382
var socketCluster = new SocketCluster ({
383
- workers: [ 9100 , 9101 , 9102 ] ,
384
- stores: [ 9001 , 9002 , 9003 ] ,
383
+ workers: 3 ,
384
+ stores: 3 ,
385
385
port: 8000 ,
386
386
appName: ' myapp' ,
387
387
workerController: ' worker.js'
0 commit comments