redis-metrics icon indicating copy to clipboard operation
redis-metrics copied to clipboard

Investigate if ioredis can be used as client

Open dlebech opened this issue 8 years ago • 3 comments

Would it be possible to remove the client restriction here and either:

  1. Allow everything, thereby putting responsibility on the library user (This would allow mock objects)
  2. Add specific support for ioredis

I'm leaning towards 1 and then explicit stating in the documentation that redis is officially supported but other libraries can (possibly) be used to.

dlebech avatar Feb 22 '17 19:02 dlebech

I'm for 1. too, but we could at least check if the methods we need are in the passed client object and if they return promises.

stefanosala avatar Feb 22 '17 19:02 stefanosala

#1 would work for me as well.

jeffmcaffer avatar Feb 23 '17 00:02 jeffmcaffer

@stefanosala @jeffmcaffer I've now tested the current suite with ioredis and there are 8 failing tests. It's possible it's something minor, but at least it's not just a matter of removing the client restriction without any further changes. I will leave this open for now, but I don't think I will have time in the near-future to deep dive into this and make it work for both clients.

However, I will still remove the client restriction so a mock object can be passed and leave responsibilty to the developer :-) This change is coming up soon.

dlebech avatar Feb 28 '17 08:02 dlebech