1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-07-12 15:44:13 +00:00

Implement locate_in_db() by hash.

This commit is contained in:
King_DuckZ 2016-07-12 16:42:27 +01:00
parent 01be1a94e5
commit afb2e68849
5 changed files with 71 additions and 2 deletions

View file

@ -24,7 +24,7 @@
namespace redis {
namespace {
inline IncRedis::opt_string optional_string ( const Reply& parReply ) a_always_inline;
inline IncRedis::opt_string_list optional_string_list ( const Reply& parReply ) a_always_inline;
IncRedis::opt_string_list optional_string_list ( const Reply& parReply );
IncRedis::opt_string optional_string (const Reply& parReply) {
assert(parReply.which() == RedisVariantType_Nil or parReply.which() == RedisVariantType_String);
@ -115,6 +115,10 @@ namespace redis {
return optional_string(m_command.run("SRANDMEMBER", parKey));
}
auto IncRedis::smembers (boost::string_ref parKey) -> opt_string_list {
return optional_string_list(m_command.run("SMEMBERS", parKey));
}
bool IncRedis::script_flush() {
const auto ret = get<StatusString>(m_command.run("SCRIPT", "FLUSH"));
return ret.is_ok();