bzp2010 commented on code in PR #7043:
URL: https://github.com/apache/apisix/pull/7043#discussion_r872256421


##########
apisix/core/pubsub.lua:
##########
@@ -58,23 +58,42 @@ local function init_pb_state()
 end
 
 
+-- parse command name and parameters from client message
+local function get_cmd(data)
+    for key, value in pairs(data) do
+        -- There are sequence and command properties in the data,
+        -- select the handler according to the command value.
+        if key ~= "sequence" then
+            return key, value
+        end
+    end
+end
+
+
+-- send generic response to client
+local function send_resp(ws, sequence, data)
+    data.sequence = sequence
+    local ok, encoded = pcall(pb.encode, "PubSubResp", data)
+    if not ok or not data then

Review Comment:
   @tzssangglass fixed



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to