Class: Redis::MultiFuture

Inherits:
Future
  • Object
show all
Defined in:
lib/redis/pipeline.rb

Constant Summary

Constants inherited from Future

Future::FutureNotReady

Instance Method Summary collapse

Methods inherited from Future

#class, #inspect, #is_a?, #value

Constructor Details

#initialize(futures) ⇒ MultiFuture

Returns a new instance of MultiFuture.



112
113
114
115
116
# File 'lib/redis/pipeline.rb', line 112

def initialize(futures)
  @futures = futures
  @command = [:exec]
  @object = FutureNotReady
end

Instance Method Details

#_set(replies) ⇒ Object



118
119
120
121
122
123
124
125
# File 'lib/redis/pipeline.rb', line 118

def _set(replies)
  if replies
    @futures.each_with_index do |future, index|
      future._set(replies[index])
    end
  end
  @object = replies
end