Skip to content

Commit 30d5ed6

Browse files
add example for $ = last_id and > for not consumed messages yet
1 parent 74abde3 commit 30d5ed6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.markdown

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3540,6 +3540,9 @@ Array
35403540

35413541
)
35423542
*/
3543+
3544+
// Receive only new message ($ = last id) and wait for one new message unlimited
3545+
$obj_redis->xRead(['stream1' => '$'], 1, 0);
35433546
~~~
35443547

35453548
### xReadGroup
@@ -3560,7 +3563,10 @@ _**Description**_: This method is similar to xRead except that it supports read
35603563
/* Consume messages for 'mygroup', 'consumer1' */
35613564
$obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => 0, 's2' => 0]);
35623565

3563-
/* Read a single message as 'consumer2' for up to a second until a message arrives. */
3566+
/* Consume messages for 'mygroup', 'consumer1' which where not consumed yet */
3567+
$obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => '>', 's2' => '>']);
3568+
3569+
/* Read a single message as 'consumer2' wait for up to a second until a message arrives. */
35643570
$obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000);
35653571
~~~
35663572

0 commit comments

Comments
 (0)