Skip to content
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

Add mset Callback interface #551

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

reneetse
Copy link
Contributor

@reneetse reneetse commented Mar 5, 2024

we need callback indicate mset request done.
test passed.

@@ -199,6 +199,13 @@ void AsyncTest<RedisInstance>::_test_hash() {
this->set_ready();
});
_wait();

set_ready(false);
std::map<std::string, std::string> mkeys = {{test_key("str")+"1", "val1"}, {test_key("str")+"2", "val2"}};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Use std::unordered_map instead of std::map, since this file doesn't include , some compiler might fail to compile.
  2. Register these two keys in KeyDeleter at the beginning of this method, so that they will be automatically deleted when the test is done.
auto key = test_key("set");
auto key1 = test_key("str1")
auto key2 = test_key("str2");

KeyDeleter<RedisInstance> deleter(_redis, {key, key1, key2});

// other code here

std::map<std::string, std::string> mkeys = {{key1, "val1"}, {key2, "val2"}}

@sewenew
Copy link
Owner

sewenew commented Mar 6, 2024

Thanks for the contribution! I added a comment. Please fix it before I merge it. Thanks a lot!

Regards

@sewenew sewenew merged commit eb3b2a4 into sewenew:master Mar 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants