Method: Redis::Distributed#_bpop

Defined in:
lib/redis/distributed.rb

#_bpop(cmd, args) ⇒ Object



476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/redis/distributed.rb', line 476

def _bpop(cmd, args)
  timeout = if args.last.is_a?(Hash)
    options = args.pop
    options[:timeout]
  end

  args.flatten!(1)

  ensure_same_node(cmd, args) do |node|
    if timeout
      node.__send__(cmd, args, timeout: timeout)
    else
      node.__send__(cmd, args)
    end
  end
end