From f9b96d5e0bb6dec41f1729b786128bd5f9e2f072 Mon Sep 17 00:00:00 2001 From: Matt Rusiniak <528239+f0ff886f@users.noreply.github.com> Date: Thu, 14 Feb 2019 16:41:50 +0100 Subject: [PATCH] Fix never-returning xreadgroup case in example By default `XGROUP CREATE` passes `$` as the ID which means "serve all IDs added from this point on". Due to that, the `XADD` directly above never gets served to the `XREADGROUP` command and this example will just hang the first time you run it waiting. Adding an explicit ID of 0 means we will get the previous message back in the `XREADGROUP`. --- examples/cpp_redis_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cpp_redis_client.cpp b/examples/cpp_redis_client.cpp index 1d3324db..49fdb8f1 100644 --- a/examples/cpp_redis_client.cpp +++ b/examples/cpp_redis_client.cpp @@ -70,7 +70,7 @@ main(void) { #ifdef ENABLE_SESSION client.xadd(session_name, "*", ins, replcmd); - client.xgroup_create(session_name, group_name, replcmd); + client.xgroup_create(session_name, group_name, "0", replcmd); client.sync_commit();