Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Schranz <alexander@sulu.io>2018-11-26 21:53:00 +0300
committerGitHub <noreply@github.com>2018-11-26 21:53:00 +0300
commit30d5ed63dbdd4c9e0d3771054216bc906a46eed2 (patch)
tree34609d8c443d0fceb859dab77f26678412a5cdd5 /README.markdown
parent74abde303edf558f72ed82e4f9c1eb72560d3055 (diff)
add example for $ = last_id and > for not consumed messages yet
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown8
1 files changed, 7 insertions, 1 deletions
diff --git a/README.markdown b/README.markdown
index e7c90a18..0d683ad7 100644
--- a/README.markdown
+++ b/README.markdown
@@ -3540,6 +3540,9 @@ Array
)
*/
+
+// Receive only new message ($ = last id) and wait for one new message unlimited
+$obj_redis->xRead(['stream1' => '$'], 1, 0);
~~~
### xReadGroup
@@ -3560,7 +3563,10 @@ _**Description**_: This method is similar to xRead except that it supports read
/* Consume messages for 'mygroup', 'consumer1' */
$obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => 0, 's2' => 0]);
-/* Read a single message as 'consumer2' for up to a second until a message arrives. */
+/* Consume messages for 'mygroup', 'consumer1' which where not consumed yet */
+$obj_redis->xReadGroup('mygroup', 'consumer1', ['s1' => '>', 's2' => '>']);
+
+/* Read a single message as 'consumer2' wait for up to a second until a message arrives. */
$obj_redis->xReadGroup('mygroup', 'consumer2', ['s1' => 0, 's2' => 0], 1, 1000);
~~~