nodeca / promise-memoize

Memoize promise-returning functions. Includes cache expire and prefetch.
MIT License
60 stars 7 forks source link

Redis or pluggable storage? #4

Closed GeoffreyPlitt closed 8 years ago

GeoffreyPlitt commented 8 years ago

Is there a way to plug in redis or other custom non-memory stores into this?

puzrin commented 8 years ago

No. Memoize-like wrappers are to remember result in memory. I'd say, if you need another backend, this package will be useless.

Also see https://github.com/nodeca/promise-memoize, may be it will be more suitable for your needs.

GeoffreyPlitt commented 8 years ago

It's fine if you'd rather not clutter this project, but there are many people who use "memoize" with non-memory storage such as memcache or redis. First one I found: https://www.npmjs.com/package/redis-memoizer

puzrin commented 8 years ago

I meaned if you need another backend, it's better to find cacher for that backend. Because cache logic depends very much on backend features. Universal solution will be more complicated than all separate.