cpp-redis / cpp_redis

C++11 Lightweight Redis client: async, thread-safe, no dependency, pipelining, multi-platform
MIT License
713 stars 198 forks source link

Fix never-returning xreadgroup case in example #11

Closed f0ff886f closed 5 years ago

f0ff886f commented 5 years ago

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.