XAUTOCLAIM

Since 1.1.0Streams

Syntax

XAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID]
  • Flags: write
  • ACL categories: @slow, @stream, @write
  • Arity: -6

Goes through the group's pending entries from start and gives consumer those idle at least min-idle-time milliseconds, COUNT count at a time (100 by default). Call again with the cursor it returns, until it returns 0-0.

Reply

A three-element array:

  1. the cursor to call again with, 0-0 when done;
  2. the entries claimed, or their IDs with JUSTID;
  3. the IDs of entries that were pending but no longer exist, now removed from the pending list.

Examples

> XAUTOCLAIM jobs workers carol 0 0-0 JUSTID
1) "0-0"
2) 1) "2-0"
   2) "3-0"
3) (empty array)