Class: Redis::Pipeline::Multi

Inherits:
Redis::Pipeline show all
Defined in:
lib/redis/pipeline.rb

Instance Attribute Summary

Attributes inherited from Redis::Pipeline

#futures

Instance Method Summary collapse

Methods inherited from Redis::Pipeline

#call, #call_pipeline, #initialize, #shutdown?, #without_reconnect, #without_reconnect?

Constructor Details

This class inherits a constructor from Redis::Pipeline

Instance Method Details

#commandsObject



67
68
69
# File 'lib/redis/pipeline.rb', line 67

def commands
  [[:multi]] + super + [[:exec]]
end

#finish(replies) ⇒ Object



56
57
58
59
60
61
62
63
64
65
# File 'lib/redis/pipeline.rb', line 56

def finish(replies)
  return if replies.last.nil? # The transaction failed because of WATCH.

  if replies.last.size < futures.size - 2
    # Some command wasn't recognized by Redis.
    raise replies.detect { |r| r.kind_of?(::Exception) }
  end

  super(replies.last)
end