A wrapper to enable the use of any in-process store with node cluster via cluster process and worker messages (i.e. for Raspberry Pi servers).
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.
 

19 lines
459 B

'use strict';
module.exports.create = function (opts) {
opts = opts || {};
var db = require('./memstore').create();
return require('cluster-rpc/master').create({
instance: opts.store || db
, methods: [
'set', 'get', 'touch', 'destroy'
, 'all', 'length', 'clear'
, 'on', 'off', 'removeEventListener', 'addEventListener'
]
, name: 'memstore.' + (opts.name || '')
, master: opts.master
, addOnFork: opts.addOnFork
});
};