Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

zetta-cluster

6.4.1 • Public • Published

Zetta Cluster

Crate a cluster of zetta instances using in memory registry.

Install

npm install zetta-cluster

Usage

var cluster = require('zetta-cluster');
var zetta = require('zetta');
var SineWave = require('zetta-sine-wave');
var LED = require('zetta-mock-led');
 
cluster({ zetta: zetta })
  .server('cloud')
  .server('detroit', [SineWave, LED], ['cloud'])
  .server('san jose', [SineWave, LED], ['cloud'])
  .server('london', [SineWave, LED], ['cloud'])
  .server('bangalore', [SineWave, LED], ['cloud'])
  .on('log', console.log)
  .on('ready', function() {
    // called when all server are connected to all of their peers
    console.log('cluster peers all connected')
  })
  .run(function(err) {
    if (err) {
      console.error(err);
      process.exit(1);
    }
    // called once all peers run zetta.listen()
  });

Licence

MIT

Keywords

install

npm i zetta-cluster

Downloadsweekly downloads

26

version

6.4.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability