-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: improve the implementation of pubsub module #7043
Conversation
apisix/core/pubsub.lua
Outdated
@@ -119,8 +138,8 @@ end | |||
-- no error exists. | |||
-- | |||
-- @function core.pubsub.on | |||
-- @tparam string command to add callback | |||
-- @tparam function handler callback on receipt of command | |||
-- @tparam string The command to add callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- @tparam string The command to add callback. | |
-- @tparam string command The command to add callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/discovery t/error_page t/misc t/pubsub | ||
- t/node t/router t/script t/stream-node t/utils t/wasm t/xds-library t/xrpc | ||
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/discovery t/error_page t/misc | ||
- t/node t/pubsub t/router t/script t/stream-node t/utils t/wasm t/xds-library t/xrpc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pubsub < node
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused, according to the principle you mentioned at #6995 (comment), p
should be in the middle of n
and r
in alphabetical order except for plugin
. lmnopqrst
apisix/core/pubsub.lua
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A careless mistake that I will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tzssangglass fixed
-- @tparam string command to add callback | ||
-- @tparam function handler callback on receipt of command | ||
-- @tparam string command The command to add callback. | ||
-- @tparam func handler The callback function on receipt of command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- @tparam function
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
According to the closed #6995 PR, there are some review comments on the pubsub module, fix it throughout the PR.
Fixes # (issue)
Checklist