Helper for rewriteStreamObject(): emit the XGROUP CREATECONSUMER is * needed in order to create consumers that do not have any pending entries. * All this in the context of the specified key and group. */
| 1271 | * needed in order to create consumers that do not have any pending entries. |
| 1272 | * All this in the context of the specified key and group. */ |
| 1273 | int rioWriteStreamEmptyConsumer(rio *r, robj *key, const char *groupname, size_t groupname_len, streamConsumer *consumer) { |
| 1274 | /* XGROUP CREATECONSUMER <key> <group> <consumer> */ |
| 1275 | if (rioWriteBulkCount(r,'*',5) == 0) return 0; |
| 1276 | if (rioWriteBulkString(r,"XGROUP",6) == 0) return 0; |
| 1277 | if (rioWriteBulkString(r,"CREATECONSUMER",14) == 0) return 0; |
| 1278 | if (rioWriteBulkObject(r,key) == 0) return 0; |
| 1279 | if (rioWriteBulkString(r,groupname,groupname_len) == 0) return 0; |
| 1280 | if (rioWriteBulkString(r,consumer->name,sdslen(consumer->name)) == 0) return 0; |
| 1281 | return 1; |
| 1282 | } |
| 1283 | |
| 1284 | /* Emit the commands needed to rebuild a stream object. |
| 1285 | * The function returns 0 on error, 1 on success. */ |
no test coverage detected