Skip to content
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

Merged
merged 7 commits into from
May 13, 2022

Conversation

bzp2010
Copy link
Contributor

@bzp2010 bzp2010 commented May 13, 2022

Description

According to the closed #6995 PR, there are some review comments on the pubsub module, fix it throughout the PR.

Fixes # (issue)

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@bzp2010 bzp2010 self-assigned this May 13, 2022
@bzp2010 bzp2010 marked this pull request as ready for review May 13, 2022 09:24
@@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- @tparam string The command to add callback.
-- @tparam string command The command to add callback.

Copy link
Contributor Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pubsub < node

Copy link
Contributor Author

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

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not data?

Copy link
Contributor Author

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- @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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-- @tparam function ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The documentation indicates that func should be used.

@spacewander spacewander merged commit 48032f1 into apache:master May 13, 2022
Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants