class Redis

def multi

Other tags:
    See: #unwatch -
    See: #watch -

Returns:
  • (String, Array<...>) -

Other tags:
    Yieldparam: multi - `self`

Other tags:
    Yield: - the commands that are called inside this block are cached

Other tags:
    Example: Without a block -
    Example: With a block -
def multi
  synchronize do |client|
    if !block_given?
      client.call([:multi])
    else
      begin
        pipeline = Pipeline::Multi.new
        original, @client = @client, pipeline
        yield(self)
        original.call_pipeline(pipeline)
      ensure
        @client = original
      end
    end
  end
end