Class: Redis::Pipeline::Multi
Instance Attribute Summary
#client, #db, #futures
Instance Method Summary
collapse
#call, #call_pipeline, #call_with_timeout, #empty?, #initialize, #shutdown?, #timeout, #with_reconnect, #with_reconnect?, #without_reconnect, #without_reconnect?
Instance Method Details
#commands ⇒ Object
115
116
117
118
119
120
121
|
# File 'lib/redis/pipeline.rb', line 115
def commands
if empty?
[]
else
[[:multi]] + super + [[:exec]]
end
end
|
#finish(replies) ⇒ Object
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'lib/redis/pipeline.rb', line 86
def finish(replies)
exec = replies.last
return if exec.nil?
raise exec if exec.is_a?(CommandError)
if exec.size < futures.size
raise replies.detect { |r| r.is_a?(CommandError) }
end
super(exec) do |reply|
reply.is_a?(::RuntimeError) ? CommandError.new(reply.message) : reply
end
end
|
#timeouts ⇒ Object
107
108
109
110
111
112
113
|
# File 'lib/redis/pipeline.rb', line 107
def timeouts
if empty?
[]
else
[nil, *super, nil]
end
end
|