{"record":{"id":"433169e4d77d335c","repo":"redis/redis-rb","slug":"pick-either-left-or-right","errorCode":null,"errorMessage":"Pick either LEFT or RIGHT","messagePattern":"Pick either LEFT or RIGHT","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/redis/commands/lists.rb","lineNumber":284,"sourceCode":"      #\n      # @example Popping a element\n      #   redis.blmpop(1.0, 'list')\n      #   #=> ['list', ['a']]\n      # @example With count option\n      #   redis.blmpop(1.0, 'list', count: 2)\n      #   #=> ['list', ['a', 'b']]\n      #\n      # @params timeout [Float] a float value specifying the maximum number of seconds to block) elapses.\n      #   A timeout of zero can be used to block indefinitely.\n      # @params key [String, Array<String>] one or more keys with lists\n      # @params modifier [String]\n      #  - when `\"LEFT\"` - the elements popped are those from the left of the list\n      #  - when `\"RIGHT\"` - the elements popped are those from the right of the list\n      # @params count [Integer] a number of elements to pop\n      #\n      # @return [Array<String, Array<String, Float>>] list of popped elements or nil\n      def blmpop(timeout, *keys, modifier: \"LEFT\", count: nil)\n        raise ArgumentError, \"Pick either LEFT or RIGHT\" unless modifier == \"LEFT\" || modifier == \"RIGHT\"\n\n        args = [:blmpop, timeout, keys.size, *keys, modifier]\n        args << \"COUNT\" << Integer(count) if count\n\n        send_blocking_command(args, timeout)\n      end\n\n      # Pops one or more elements from the first non-empty list key from the list\n      # of provided key names.\n      #\n      # @example Popping a element\n      #   redis.lmpop('list')\n      #   #=> ['list', ['a']]\n      # @example With count option\n      #   redis.lmpop('list', count: 2)\n      #   #=> ['list', ['a', 'b']]\n      #\n      # @params key [String, Array<String>] one or more keys with lists","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/redis/redis-rb/blob/2ba9010b91dab9e0fde1fbae3a9aae003f8bc307/lib/redis/commands/lists.rb#L266-L302","documentation":"Error \"Pick either LEFT or RIGHT\" thrown in redis/redis-rb.","triggerScenarios":"Thrown at lib/redis/commands/lists.rb:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass either :left or :right as the where argument, not both and not neither.","Use where: :left to pop from the source and push to the head, or where: :right for the tail."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2ba9010b91dab9e0fde1fbae3a9aae003f8bc307","analyzedAt":"2026-08-23T03:54:57.017Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}