| 175 | } |
| 176 | |
| 177 | static 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 | |
| 200 | static void xack(acl::redis_stream& redis, const char* group, |
| 201 | const char* id, bool detail = true) |
no test coverage detected
searching dependent graphs…