- xlisten_group(+Redis, +Group, +Consumer, +Streams, +Options)
- Listen as Consumer to Group. This is similar to xlisten/3, with the
following differences:
Options processed:
- block +Seconds
- Causes
XREADGROUP
to return with timeout when no messages
arrive within Seconds. On a timeout, xidle_group/5 is called
which will try to handle messages to other consumers pending
longer than Seconds. Choosing the time depends on the
application. Notably:
- Using a time shorter than the required processing time
will make the job migrate from consumer to consumer until
max_deliveries(Count)
is exceeded. Note that the original
receiver does not notice that the job is claimed and thus
multiple consumers may ultimately answer the message.
- Using a too long time causes an unnecessarily long delay
if a node fails.
- max_deliveries(+Count)
- Re-deliver (using
XCLAIM
) a message max Count times.
Exceeding this calls xhook/2. Default Count is 3
.
- max_claim(+Count)
- Do not claim more than Count messages during a single idle
action. Default is
10
.