Permalink
Browse files

[ depend on github.com/mranney/node_redis ]

  • Loading branch information...
1 parent 952c47c commit 9df1e0703d85be93c23bdec2a4978070267ef14e @jbr committed Oct 2, 2010
Showing with 14 additions and 12 deletions.
  1. +1 −0 bin/node-resque-worker
  2. +10 −6 lib/resque.js
  3. +3 −6 package.json
View
@@ -33,6 +33,7 @@ if (process.env.NODE_DEBUG)
var resque = require ('../lib/resque')
.connect (options)
+var resque = require ('resque').connect (options)
resque.cleanStaleWorkers ()
View
@@ -1,6 +1,6 @@
var resque = exports
var EventEmitter = require ('events').EventEmitter
-var sys = require ('sys')
+var sys = require ('sys')
var processAlive = function (pid, cb) {
require('child_process').exec (
@@ -11,12 +11,16 @@ var processAlive = function (pid, cb) {
)
}
+var connectToRedis = function (options) {
+ return require ('redis').createClient (options.port, options.host)
+}
+
+
resque.connect = function (options) {
- var options = options || {}
- var redis = options.redis ||
- require ('redis-client').createClient (options.port, options.host)
- var namespace = options.namespace || 'resque'
- var connection = {redis: redis, namespace: namespace}
+ var options = options || {}
+ var redis = options.redis || connectToRedis(options)
+ var namespace = options.namespace || 'resque'
+ var connection = { redis: redis, namespace: namespace }
var key = function () {
var args = Array.prototype.slice.apply (arguments)
View
@@ -1,5 +1,5 @@
{ "name": "resque"
-, "version": "0.0.2"
+, "version": "0.0.3"
, "keywords": [ "redis", "resque", "worker", "queue"]
, "description": "resque (a redis-backed work queue) for node"
, "contributors":
@@ -11,10 +11,7 @@
, "url": "http://github.com/jbr/node-resque.git"
}
, "bugs": { "web": "http://github.com/jbr/node-resque/issues" }
-, "directories":
- { "lib": "./lib"
- , "test": "./bin"
- }
-, "dependencies": { "redis-client": ">= 0.3.4" }
+, "dependencies": { "redis": ">= 0.3.2" }
+, "main": "./lib/resque"
, "bin": { "node-resque-worker": "./bin/node-resque-worker" }
}

0 comments on commit 9df1e07

Please sign in to comment.