feat(streams): Add support for XREAD BLOCK (#1291)

* feat(streams): Add support for XREAD BLOCK

---------

Signed-off-by: Andrew Dunstall <andydunstall@hotmail.co.uk>
This commit is contained in:
Andy Dunstall 2023-05-27 20:47:31 +01:00 committed by GitHub
parent bc717a037d
commit 1cfeff21a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 309 additions and 73 deletions

View file

@ -212,9 +212,9 @@ void BlockingController::NotifyPending() {
// Double verify we still got the item.
auto [it, exp_it] = owner_->db_slice().FindExt(context, sv_key);
if (!IsValid(it) ||
!(it->second.ObjType() == OBJ_LIST ||
it->second.ObjType() == OBJ_ZSET)) // Only LIST and ZSET are allowed to block.
// Only LIST, ZSET and STREAM are allowed to block.
if (!IsValid(it) || !(it->second.ObjType() == OBJ_LIST || it->second.ObjType() == OBJ_ZSET ||
it->second.ObjType() == OBJ_STREAM))
continue;
NotifyWatchQueue(sv_key, &wt.queue_map);