jamesge commented on a change in pull request #972: Redis server protocol
URL: https://github.com/apache/incubator-brpc/pull/972#discussion_r356952231
 
 

 ##########
 File path: src/brpc/redis.h
 ##########
 @@ -209,7 +213,54 @@ class RedisResponse : public ::google::protobuf::Message {
 std::ostream& operator<<(std::ostream& os, const RedisRequest&);
 std::ostream& operator<<(std::ostream& os, const RedisResponse&);
 
-} // namespace brpc
+class RedisCommandHandler;
+
+// Implement this class and assign an instance to ServerOption.redis_service
+// to enable redis support. 
+class RedisService {
+public:
+    typedef std::unordered_map<std::string, 
std::shared_ptr<RedisCommandHandler>> CommandMap;
+    virtual ~RedisService() {}
+    
+    // Call this function to register `handler` that can handle command `name`.
+    bool AddCommandHandler(const std::string& name, RedisCommandHandler* 
handler);
+
+    // This function should be touched by user and used by brpc deverloper 
only.
 
 Review comment:
   should not be

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to