Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add brpop cmd #48
base: unstable
Are you sure you want to change the base?
feat: add brpop cmd #48
Changes from 10 commits
d525c40
80a5fec
c5d9c3f
ea7da1b
60c7bf8
561f034
0ae4aa2
fec46cd
3ad6f20
30830a4
9bb4f81
5b0332f
94b9a33
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto waitting_list = it->second;
这样写就行了吧, 不需要加 引用, 或者加了 引用有什么特殊作用吗There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的迭代器 在哪里 ++ 的, 不在 for()的最后
++conn_blocked
是出于什么考虑There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的错误码能兼容redis吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Handle potential exceptions in ServeAndUnblockConns.
The method should use RAII to ensure resources are properly cleaned up if
SendPacket
throws an exception.Consider using a scope guard or try-catch block:
📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
判断是否过期, 从调用
IsExpired
的地方传递一个 时间戳过来, 会不会更好,或者提供一个函数重载,可以通过外部传入时间戳, 避免在多次调用时,重复获取当前时间There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里依然会出现hash碰撞的情况吧,只是概率大小的问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement BLPopCmd functionality.
The BLPopCmd has an empty implementation. It should mirror BRPopCmd's functionality but for the left side of the list.
Would you like me to generate the implementation for BLPopCmd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling for SendPacket in ScanEvictedBlockedConnsOfBlrpop.
The method should handle potential exceptions from
SendPacket
to ensure proper cleanup.📝 Committable suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix potential iterator invalidation in CleanBlockedNodes.
The method modifies the list while iterating, which could lead to iterator invalidation.
📝 Committable suggestion