soveran / nest

Generate nested namespaced keys for key-value databases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make nest depends on Redic instead of Redis

phuongnd08 opened this issue · comments

I think Redic seem to be the better option. Per my experience, Redic doesn't yield issue when being wrapped inside an EventMachine block.

Good idea, I will explore it in the next few days.

Right now nest is calling redis with an extra &block argument (L33):

redis.send(meth, self, *args, &block)

Passed block redis uses in some methods, e.g. subscribe in redis.rb:

 def subscribe(*channels, &block)
    synchronize do |client|
      _subscription(:subscribe, channels, block)
    end
  end

In this case &block is called asynchronously, which is not supported in redic. In order to maintain same functionality in nest we would have to implement methods like subscribe , psubscribe, scan_each, hscan_each, etc. Or extend redic to support this, but it might be against the design principle of redic.

What do you think?

How are you using Nest? I just checked that Ohm 1.4.x uses Nest 1.x, so we can make Nest use Redic and release it as 2.0, breaking any compatibility if necessary. What do you think about that?

Sounds like a good idea. I'm using Nest along with Ohm 2.2.

Done, it is available in Nest 2.0.0. Thanks!