Permalink
Browse files

recovery code

  • Loading branch information...
1 parent d9f309e commit 799b397efb5cd5bec288a36e4c4544334334af3b @dead-horse committed Oct 26, 2012
Showing with 594 additions and 4 deletions.
  1. +100 −0 History.md
  2. +7 −0 Makefile
  3. +0 −4 README.md
  4. +37 −0 Readme.md
  5. +21 −0 bm.js
  6. +232 −0 index.html
  7. +2 −0 index.js
  8. +131 −0 lib/connect-mredis.js
  9. +24 −0 package.json
  10. +40 −0 test.js
View
@@ -0,0 +1,100 @@
+
+1.2.0 / 2011-11-17
+==================
+
+ * Added an option 'client' to reuse an existing redis Client [Thomas Fritz]
+
+1.1.0 / 2011-10-05
+==================
+
+ * Added `prefix` option
+ * Removed `clear()` and `length()` methods
+
+1.0.7 / 2011-08-04
+==================
+
+ * Fixed: re-select db on connection (reconnection logic issue with node_redis)
+
+1.0.6 / 2011-06-21
+==================
+
+ * Added `socket` option so that we can connect to a sockets as well [mekwall]
+
+1.0.5 / 2011-06-02
+==================
+
+ * Implemented `require("connect-redis")(connect)` for npm 1.x. Closes #23
+
+1.0.4 / 2011-05-01
+==================
+
+ * Changed; issue SELECT immediately since it is queued
+
+1.0.3 / 2011-04-17
+==================
+
+ * Fixed auth support again [garrensmith]
+
+1.0.2 / 2011-04-15
+==================
+
+ * Fixed auth support [garrensmith]
+
+1.0.1 / 2011-04-14
+==================
+
+ * Added authentication support [garrensmith]
+
+1.0.0 / 2011-02-25
+==================
+
+ * Added connect 1.0 support.
+ This release will _not_ work with older versions of connect.
+
+0.2.3 / 2011-02-01
+==================
+
+ * Refactoring
+
+0.2.2 / 2011-01-02
+==================
+
+ * Added `db` option [Clément]
+
+0.2.1 / 2010-12-20
+==================
+
+ * Redis is now an npm dep
+
+0.2.0 / 2010-11-01
+==================
+
+ * Use __SETEX__ instead of __SET__ / __EXPIRE__ combo
+ this should be reasonably faster.
+
+0.1.3 / 2010-10-25
+==================
+
+ * Updated redis
+
+0.1.2 / 2010-09-22
+==================
+
+ * Updated redis
+
+0.1.1 / 2010-09-20
+==================
+
+ * Fixed expires, `maxAge` in seconds
+ * Updated redis
+
+0.1.0 / 2010-09-17
+==================
+
+ * Now using node_redis as the client, much faster
+
+0.0.2 / 2010-07-27
+==================
+
+ * Moved redis to lib/redis
+ * Added lib/connect-redis.js
View
@@ -0,0 +1,7 @@
+
+index.html: lib/connect-redis.js
+ dox \
+ --title "Connect Redis" \
+ --desc "Redis session store for connect backed by [node_redis](http://github.com/mranney/node_redis)." \
+ --ribbon "http://github.com/visionmedia/connect-redis" \
+ $< > $@
View
@@ -1,4 +0,0 @@
-connect-mredis
-==============
-
-conenct-redis for multi_redis
View
@@ -0,0 +1,37 @@
+
+# Connect Redis
+
+connect-redis is a Redis session store backed by [node_redis](http://github.com/mranney/node_redis), and is insanely fast :). Requires redis >= `1.3.10` for the _SETEX_ command.
+
+ connect-redis `>= 1.0.0` support only connect `>= 1.0.0`.
+
+## Installation
+
+ $ npm install connect-redis
+
+## Options
+
+ - `client` An existing redis client object you normally get from `redis.createClient()`
+ - `host` Redis server hostname
+ - `port` Redis server portno
+ - `db` Database index to use
+ - `pass` Password for Redis authentication
+ - `prefix` Key prefix defaulting to "sess:"
+ - ... Remaining options passed to the redis `createClient()` method.
+
+## Usage
+
+ Due to npm 1.x changes, we now need to pass connect to the function `connect-redis` exports in order to extend `connect.session.Store`:
+
+ var connect = require('connect')
+ , RedisStore = require('connect-redis')(connect);
+
+ connect.createServer(
+ connect.cookieParser(),
+ // 5 minutes
+ connect.session({ store: new RedisStore, secret: 'keyboard cat' })
+ );
+
+ This means express users may do the following, since `express.session.Store` points to the `connect.session.Store` function:
+
+ var RedisStore = require('connect-redis')(express);
View
21 bm.js
@@ -0,0 +1,21 @@
+
+var redis = require('./lib/redis')
+ , times = 100000;
+
+var n = times
+ , pending = n
+ , client = redis.createClient()
+ , start = new Date;
+
+client.on('connect', function(){
+ while (n--) {
+ client.set('foo:' + n, 'bar', function(err){
+ if (err) throw err;
+ --pending || report();
+ });
+ }
+});
+
+function report() {
+ console.log('\x1b[33m%d\x1b[0m sets in \x1b[32m%d\x1b[0m milliseconds', times, new Date - start);
+}
Oops, something went wrong.

0 comments on commit 799b397

Please sign in to comment.