I'm connecting to a remote Redis server on another machine (e.g. not using the default localhost IP/port) and using the connect-redis plugin as-is causes things to fail since it can't connect. This change adds the ability to supply an existing client connection.
Added support for passing a pre-populated redis client connection
Just out of curiosity: What exactly is the problem why connect-redis can't connect to the server but another client can?
If I already have a client connection object created for my object store, why should I have to supply hostname and password credentials in multiple places? Other Node libraries appear to accept an existing client to a property setter, which means I can just create my one client object and can pass that around.
Okay, so it's not so much a "cannot use it" but more a "would like to use it more comfortable". Seems good to me. :)
(The reason I'm using up to 3 seperate clients (connect sessions, model storage and other) is that I select different databases with each to keep my stuff seperated.)
That makes sense. Largely I'd like to consolidate the creation of my database connections so that I don't have hostnames strewn throughout my code. My project hasn't gotten to the point where I need to segregate my databases (I'm sure I'll get there shortly) but having options is always nice.
oh, i just saw your pull request. Maybe this one solves your problem: visionmedia#14
Why hasn't this been merged yet? Any reason not to use a singleton connection object?
looks like its being handled here now: https://github.com/visionmedia/connect-redis/blob/master/lib/connect-redis.js#L52
as badunk said, you can pass connection object.