Method: Redis::Commands::Lists#blmpop
- Defined in:
- lib/redis/commands/lists.rb
#blmpop(timeout, *keys, modifier: "LEFT", count: nil) ⇒ Array<String, Array<String, Float>>
Pops one or more elements from the first non-empty list key from the list of provided key names. If lists are empty, blocks until timeout has passed.
205 206 207 208 209 210 211 212 |
# File 'lib/redis/commands/lists.rb', line 205 def blmpop(timeout, *keys, modifier: "LEFT", count: nil) raise ArgumentError, "Pick either LEFT or RIGHT" unless modifier == "LEFT" || modifier == "RIGHT" args = [:blmpop, timeout, keys.size, *keys, modifier] args << "COUNT" << Integer(count) if count send_blocking_command(args, timeout) end |