MCPcopy Create free account
hub / github.com/acl-dev/acl / xreadgroup

Function xreadgroup

lib_acl_cpp/samples/redis/redis_stream/redis_stream.cpp:153–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153static void xreadgroup(acl::redis_stream& redis, const char* group,
154 const char* consumer)
155{
156 acl::redis_stream_messages messages;
157 std::map<acl::string, acl::string> streams;
158 streams[__key] = ">";
159 if (redis.xreadgroup(messages, group, consumer, streams) == false) {
160 printf("xreadgroup error=%s, key=%s, group=%s, consumer=%s\r\n",
161 redis.result_error(), __key.c_str(), group, consumer);
162 const acl::string* req = redis.request_buf();
163 printf("request=[%s]\r\n", req ? req->c_str() : "NULL");
164 return;
165 }
166
167 printf("xreadgroup ok, key=%s, group=%s, consumer=%s\r\n",
168 __key.c_str(), group, consumer);
169
170 if (messages.empty()) {
171 printf("no messages\r\n");
172 } else {
173 show_messages(messages);
174 }
175}
176
177static void xread(acl::redis_stream& redis, size_t count)
178{

Callers 2

mainFunction · 0.85
xreadgroup_with_noackMethod · 0.85

Calls 5

show_messagesFunction · 0.85
xreadgroupMethod · 0.80
result_errorMethod · 0.80
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…