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

Function xread

lib_acl_cpp/samples/redis/redis_stream/redis_stream.cpp:177–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177static void xread(acl::redis_stream& redis, size_t count)
178{
179 acl::redis_stream_messages messages;
180 std::map<acl::string, acl::string> streams;
181 streams[__key] = "0-0";
182
183 if (redis.xread(messages, streams, count) == false) {
184 printf("xread error=%s, key=%s\r\n",
185 redis.result_error(), __key.c_str());
186 const acl::string* req = redis.request_buf();
187 printf("request=[%s]\r\n", req ? req->c_str() : "NULL");
188 return;
189 }
190
191 printf("xread ok, key=%s\r\n", __key.c_str());
192
193 if (messages.empty()) {
194 printf("no messages\r\n");
195 } else {
196 show_messages(messages);
197 }
198}
199
200static void xack(acl::redis_stream& redis, const char* group,
201 const char* id, bool detail = true)

Callers 1

mainFunction · 0.85

Calls 5

show_messagesFunction · 0.85
xreadMethod · 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…