Sha256: d039ddfb39bc3b5404b5faeccb60799d1113b9f54c64d8ff2f0a5105a4237481

Contents?: true

Size: 880 Bytes

Versions: 2

Compression:

Stored size: 880 Bytes

Contents

module Oxblood
  module Commands
    module Transactions
      # Mark the start of a transaction block
      # @see http://redis.io/commands/multi
      #
      # @return [String] 'OK'
      # @return [RError] if multi called inside transaction
      def multi
        run(:MULTI)
      end

      # Execute all commands issued after MULTI
      # @see http://redis.io/commands/exec
      #
      # @return [Array] each element being the reply to each of the commands
      #   in the atomic transaction
      # @return [nil] when WATCH was used and execution was aborted
      def exec
        run(:EXEC)
      end

      # Discard all commands issued after MULTI
      # @see http://redis.io/commands/discard
      #
      # @return [String] 'OK'
      # @return [RError] if called without transaction started
      def discard
        run(:DISCARD)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oxblood-0.1.0.dev10 lib/oxblood/commands/transactions.rb
oxblood-0.1.0.dev9 lib/oxblood/commands/transactions.rb