MCPcopy Create free account
hub / github.com/F-Stack/f-stack / streamLastValidID

Function streamLastValidID

app/redis-6.2.6/src/t_stream.c:1337–1345  ·  view source on GitHub ↗

Get the last valid (non-tombstone) streamID of 's'. */

Source from the content-addressed store, hash-verified

1335
1336/* Get the last valid (non-tombstone) streamID of 's'. */
1337void streamLastValidID(stream *s, streamID *maxid)
1338{
1339 streamIterator si;
1340 streamIteratorStart(&si,s,NULL,NULL,1);
1341 int64_t numfields;
1342 if (!streamIteratorGetID(&si,maxid,&numfields) && s->length)
1343 serverPanic("Corrupt stream, length is %llu, but no max id", (unsigned long long)s->length);
1344 streamIteratorStop(&si);
1345}
1346
1347/* Emit a reply in the client output buffer by formatting a Stream ID
1348 * in the standard <ms>-<seq> format, using the simple string protocol

Callers 2

xreadCommandFunction · 0.85
xsetidCommandFunction · 0.85

Calls 3

streamIteratorStartFunction · 0.85
streamIteratorGetIDFunction · 0.85
streamIteratorStopFunction · 0.85

Tested by

no test coverage detected