Provides a simple class/mixin as base for when you need to wraps a redis client (or provide API that does) via a use() method
Because I wrote this too many times already, I decided to just move it into a small module of its own.
'redis-wrapper'// or mix into a singleton object with underscoreMySingleton = ;MySingleton = _extendMySingleton 'redis-wrapper';
Setup your classes with
'redis-wrapper';var instance =client = require'redis'createClient;instanceuseclient;
ensureClient() before redis-related methods to ensure a client is set.
thisensureClient;// do things with this.client;
- Adds ability to use a url (via
redis-url) or host/port combination.