Class: Redis::Pipeline::Multi
Constant Summary
REDIS_INTERNAL_PATH, STDLIB_PATH
Instance Attribute Summary
#client, #db, #futures
Instance Method Summary
collapse
#call, #call_pipeline, #call_with_timeout, deprecation_warning, #empty?, #initialize, #shutdown?, #timeout, #with_reconnect, #with_reconnect?, #without_reconnect, #without_reconnect?
Instance Method Details
#commands ⇒ Object
198
199
200
201
202
203
204
|
# File 'lib/redis/pipeline.rb', line 198
def commands
if empty?
[]
else
[[:multi]] + super + [[:exec]]
end
end
|
#finish(replies) ⇒ Object
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
# File 'lib/redis/pipeline.rb', line 156
def finish(replies)
exec = replies.last
return if exec.nil?
raise exec if exec.is_a?(CommandError)
if exec.size < futures.size
command_error = replies.detect { |r| r.is_a?(CommandError) }
raise command_error
end
super(exec) do |reply|
reply.is_a?(::RuntimeError) ? CommandError.new(reply.message) : reply
end
end
|
#materialized_futures ⇒ Object
178
179
180
181
182
183
184
185
186
187
188
|
# File 'lib/redis/pipeline.rb', line 178
def materialized_futures
if empty?
[]
else
[
Future.new([:multi], nil, 0),
*futures,
MultiFuture.new(futures)
]
end
end
|
#timeouts ⇒ Object
190
191
192
193
194
195
196
|
# File 'lib/redis/pipeline.rb', line 190
def timeouts
if empty?
[]
else
[nil, *super, nil]
end
end
|