Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
feathers-cluster
Advanced tools
Easily take advantage of multi-core systems for Featherjs.
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
}
}));
// ....
See the docs.
Copyright (c) 2014 Glavin Wiechert
Licensed under the MIT license.
FAQs
Easily take advantage of multi-core systems for Featherjs.
The npm package feathers-cluster receives a total of 0 weekly downloads. As such, feathers-cluster popularity was classified as not popular.
We found that feathers-cluster demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.