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

 ##########
 File path: src/brpc/redis.h
 ##########
 @@ -209,6 +209,44 @@ class RedisResponse : public ::google::protobuf::Message {
 std::ostream& operator<<(std::ostream& os, const RedisRequest&);
 std::ostream& operator<<(std::ostream& os, const RedisResponse&);
 
+enum RedisCommandResult {
+    REDIS_COMMAND_OK = 0,
+    REDIS_COMMAND_CONTINUE = 1,
+    REDIS_COMMAND_ERROR = 2,
+};
+
+// The handler for a redis command. Run() and New() should be implemented
+// by user. For Run(), `args` is the redis command argument. For example,
+// "set foo bar" corresponds to args[0] == "set", args[1] == "foo" and
+// args[2] == "bar". `output` is the content that sent to client side,
+// which should be set by user.  Read brpc/src/redis_message.h for more usage.
+// `arena` is the memory arena that `output` would use.
+// For New(), whenever a tcp connection is established, all handlers would
+// be cloned and brpc makes sure that all requests of the same command name
 
 Review comment:
   对clone的理解一般是“复制”,包括内部状态,这里是么?我们之前叫clone只是口头沟通,注释里可以更精准一些

----------------------------------------------------------------
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