(ws) redis_subscribe and redis_publish can take a password + display subscribe response

This commit is contained in:
Benjamin Sergeant
2019-03-26 09:33:22 -07:00
parent b17a5e5f0b
commit 91198aca0d
6 changed files with 85 additions and 3 deletions

View File

@ -15,6 +15,7 @@ namespace ix
class RedisClient {
public:
using OnRedisSubscribeResponseCallback = std::function<void(const std::string&)>;
using OnRedisSubscribeCallback = std::function<void(const std::string&)>;
RedisClient() = default;
@ -23,10 +24,14 @@ namespace ix
bool connect(const std::string& hostname,
int port);
bool auth(const std::string& password,
std::string& response);
bool publish(const std::string& channel,
const std::string& message);
bool subscribe(const std::string& channel,
const OnRedisSubscribeResponseCallback& responseCallback,
const OnRedisSubscribeCallback& callback);
private: