Socket
Socket
Sign inDemoInstall

feathers-cluster

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

feathers-cluster

Easily take advantage of multi-core systems for Featherjs.


Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

feathers-cluster Build Status

Easily take advantage of multi-core systems for Featherjs.

Getting Started

To install feathers-cluster from npm, run:

$ npm install feathers-cluster --save

Finally, to use the plugin in your Feathers app:

// Require
var feathers = require('feathers');
var cluster = require('feathers-cluster');
// Get a Feathers server
var app = feathers();
// ...

// ===== Usage =====
// app.configure(cluster());
app.configure(cluster({
    // Customize
    cores: 4, // Optional: Force number of cores, defaults to number of CPUs.
    // Customize the Cluster
    cluster: function(cluster) {
        // See http://nodejs.org/api/cluster.html
        cluster.on('fork', function (worker) {
            console.log('forked worker ' + worker.process.pid);
        });
        cluster.on('listening', function(worker, address) {
            console.log('worker ' + worker.process.pid + ' is now connected to ' + address.address + ':' + address.port);
        });
        cluster.on('exit', function(worker, code, signal) {
            console.log('worker ' + worker.process.pid + ' died');
        });
    },
    // Important: Do NOT configure Socket.io yourself, 
    // instead put your Socket.io configuration in the function below.
    socketio: function(io) {
        // Example Socket.io configuration
        io.enable('browser client minification');  // send minified client
        io.enable('browser client etag');          // apply etag caching logic based on version number
        io.enable('browser client gzip');          // gzip the file
        io.set('log level', 1);                    // reduce logging
    }
}));

// ....

Documentation

See the docs.

Author

License

Copyright (c) 2014 Glavin Wiechert

Licensed under the MIT license.

Keywords

FAQs

Package last updated on 16 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc