added new commands; fixed handling of broken connections

This commit is contained in:
Günter Obiltschnig
2019-04-05 13:03:57 +02:00
parent 2e26da9b34
commit 196540ce34
4 changed files with 67 additions and 2 deletions

View File

@@ -119,6 +119,16 @@ Command Command::get(const std::string& key)
}
Command Command::exists(const std::string& key)
{
Command cmd("EXISTS");
cmd << key;
return cmd;
}
Command Command::hdel(const std::string& hash, const std::string& field)
{
Command cmd("HDEL");
@@ -683,6 +693,16 @@ Command Command::rpush(const std::string& list, const StringVec& values, bool cr
}
Command Command::expire(const std::string& key, Int64 seconds)
{
Command cmd("EXPIRE");
cmd << key << NumberFormatter::format(seconds);
return cmd;
}
Command Command::ping()
{
Command cmd("PING");
@@ -691,4 +711,28 @@ Command Command::ping()
}
Command Command::multi()
{
Command cmd("MULTI");
return cmd;
}
Command Command::exec()
{
Command cmd("EXEC");
return cmd;
}
Command Command::discard()
{
Command cmd("DISCARD");
return cmd;
}
} } // namespace Poco::Redis