causes/mock_redis — pull request #62 by axos88 (2013-08-01 12:07:38+00:00)
Title: Add futures

Added the ability to return futures in a pipeline. This enables us to use something like this with mock_redis just like we use it with the real redis:

mr = MockRedis.new

mr.set("foo", "hello")
mr.set("bar", "world")

mr.pipelined do |redis|
@future_foo = redis.get("foo")
@future_bar = redis.get("bar")
end
(...)

future_foo.value # returns "hello"
future_bar.value # returns "world"