You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

clustering

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clustering

A small cluster module with plugin system

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
32
18.52%
Maintainers
1
Weekly downloads
 
Created
Source

Clustering

A small cluster module with a plugin system

Install

npm install clustering

Usage

var clustering = require('clustering');

if(clustering.side == 'master')
	clustering.spawn()

if(clustering.side == 'worker')
	yourServer.listen(3000)

And that will create a cluster running yourServer.

You can also use a plugin EG. use(clustering.watch()) (watches all files that are loaded)

API

  • use(plugin(Cluster)) => Use a plugin (execute it passing in the cluster)
  • reload(full = false) => Reload the workers, if full is true then also reload the master
  • kill(signal = 'SIGKILL') => Killall the workers with signal
  • side => 'master' if it's the master, 'worker' if it's a worker

Plugins

  • watch(full = true) => Automatically reload the cluster
    • full => Whether or not to to a full restart

Keywords

cluster

FAQs

Package last updated on 27 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts