Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Rodriguez committed Aug 22, 2012
1 parent e1ed0a9 commit dfb9d9b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules
40 changes: 40 additions & 0 deletions index.js
@@ -0,0 +1,40 @@
var redis = require('haredis')
, hydration = require('hydration')

exports.attach = function (options) {
var amino = this
, client

if (typeof options === 'string') {
var split = options.split(':');
options = {host: split[0], port: split[1]};
}
else if (typeof options === 'number') {
options = {port: options};
}
else {
options || (options = {host: 'localhost', port: 6379});
}

if (options.nodes) {
// haredis node list
client = redis.createClient(options.nodes, options);
}
else {
client = redis.createClient(options.port, options.host, options);
}

client.on('error', amino.emit.bind(amino, 'error'));

client.on('message', function (channel, packet) {

});

this.publish = function () {
var args = Array.prototype.slice.call(arguments)
, ev = args.shift()

args = hydration.dehydrate(args);

};
};
19 changes: 19 additions & 0 deletions package.json
@@ -0,0 +1,19 @@
{
"name": "amino-redis",
"version": "0.0.0",
"description": "Redis plugin for amino 1.x",
"main": "index.js",
"scripts": {
"test": "make test"
},
"repository": {
"type": "git",
"url": "https://github.com/amino/amino-redis.git"
},
"author": "Carlos Rodriguez",
"license": "MIT",
"dependencies": {
"haredis": "~0.2.8",
"hydration": "~0.3.1"
}
}

0 comments on commit dfb9d9b

Please sign in to comment.