module Redis::Commands::Streams

def xpending(key, group, *args, idle: nil)

Returns:
  • (Array) - the pending entries details if options were specified
  • (Hash) - the summary of pending entries

Options Hash: (**opts)
  • :idle (Integer) -- pending message minimum idle time in milliseconds

Parameters:
  • consumer (String) -- the consumer name
  • count (Integer) -- count the number of entries as limit
  • end (String) -- end last entry id of range
  • start (String) -- start first entry id of range
  • group (String) -- the consumer group name
  • key (String) -- the stream key

Other tags:
    Example: With range and consumer options -
    Example: With range and idle time options -
    Example: With range options -
    Example: With key and group -
def xpending(key, group, *args, idle: nil)
  command_args = [:xpending, key, group]
  command_args << 'IDLE' << Integer(idle) if idle
  case args.size
  when 0, 3, 4
    command_args.concat(args)
  else
    raise ArgumentError, "wrong number of arguments (given #{args.size + 2}, expected 2, 5 or 6)"
  end
  summary_needed = args.empty?
  blk = summary_needed ? HashifyStreamPendings : HashifyStreamPendingDetails
  send_command(command_args, &blk)
end