Merge pull request #6547 from guybe7/module_api_streams

Support streams in general module API functions
This commit is contained in:
Salvatore Sanfilippo
2019-11-21 10:03:50 +01:00
committed by GitHub
4 changed files with 12 additions and 1 deletions

View File

@ -67,6 +67,12 @@ void freeStream(stream *s) {
zfree(s);
}
/* Return the length of a stream. */
unsigned long streamLength(const robj *subject) {
stream *s = subject->ptr;
return s->length;
}
/* Generate the next stream item ID given the previous one. If the current
* milliseconds Unix time is greater than the previous one, just use this
* as time part and start with sequence part of zero. Otherwise we use the