mediocre / petty-cache

A cache module for Node.js that uses a two-level cache (in-memory cache for recently accessed data plus Redis for distributed caching) with some extra features to avoid cache stampedes and thundering herds. Also includes mutex and semaphore distributed locking primitives.
https://www.npmjs.org/package/petty-cache
Apache License 2.0
23 stars 6 forks source link

Allow injection of redis client #9

Closed elyobo closed 4 years ago

elyobo commented 7 years ago

I'd like to use this to talk to clustered redis, but the current implementation requires the use of the redis package which doesn't yet have redis cluster support. If there was some way to change the way that the client rather than hard coding the use of the redis client it would allow the use of other libraries which do have that support.

freshlogic commented 4 years ago

Thanks to @crazyrohila this was implemented. I merged it today and it's out on NPM as v2.6.0.