noredis
This is extremely experimental stuff
This is a simple "shared storage" for nodejs cluster without redis-like daemon.
Features
- set/get/del/exists/incr/decr/incrby/decrby/keys
- hset/hget/hdel/hexists/hincrby/hlen/hkeys/hvals/hgetall
- echo/flushall/flushdb
- TODO: ....
- see also redis command reference for supported commands
Install
npm install noredis
or
npm install git@github.com:iolo/node-noredis.git
How to Use(with cluster)
- do
require('noredis')
before fork the first worker.
- use noredis in workers.
- that's all folks.
var cluster = require('cluster'),
noredis = require('noredis');
if (cluster.isMaster()) {
...
cluster.fork();
...
} else {
...
noredis.set('foo', 123);
noredis.get('foo', function(err, reply) {
console.log('foo is ' + reply);
});
}
How to Use(without cluster)
- simply
require('noredis')
and use it.
- that's all ;)
var noredis = require('noredis');
...
noredis.set('foo', 123);
noredis.get('foo', function(err, reply) {
console.log('foo is ' + reply);
});