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. */
| 1370 | * needed in order to create consumers that do not have any pending entries. |
| 1371 | * All this in the context of the specified key and group. */ |
| 1372 | int rioWriteStreamEmptyConsumer(rio *r, robj *key, const char *groupname, size_t groupname_len, streamConsumer *consumer) { |
| 1373 | /* XGROUP CREATECONSUMER <key> <group> <consumer> */ |
| 1374 | if (rioWriteBulkCount(r,'*',5) == 0) return 0; |
| 1375 | if (rioWriteBulkString(r,"XGROUP",6) == 0) return 0; |
| 1376 | if (rioWriteBulkString(r,"CREATECONSUMER",14) == 0) return 0; |
| 1377 | if (rioWriteBulkObject(r,key) == 0) return 0; |
| 1378 | if (rioWriteBulkString(r,groupname,groupname_len) == 0) return 0; |
| 1379 | if (rioWriteBulkString(r,consumer->name,sdslen(consumer->name)) == 0) return 0; |
| 1380 | return 1; |
| 1381 | } |
| 1382 | |
| 1383 | /* Emit the commands needed to rebuild a stream object. |
| 1384 | * The function returns 0 on error, 1 on success. */ |
no test coverage detected