A simple way to wrap a single-instance module to enable it to work with node cluster.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

18 lines
541 B

'use strict';
module.exports.create = function (opts) {
//var msgPrefix = 'cluster-rpc.' + opts.name;
//var rpcPrefix = msgPrefix + '.rpc';
//var resultPrefix = msgPrefix + '.result';
//var initPrefix = msgPrefix + '.init';
var root = 'com.daplie.cluster-rpc.' + (opts.name ? opts.name + '.' : '');
return {
root: root
, rpc: root + 'rpc'
, result: root + 'result'
, init: root + 'init'
, connect: root + 'connect'
// TODO the things that are using this should probably accept opts
, debug: opts.debug
};
};