Skip to content

chore: improve the implementation of pubsub module#7043

Merged
spacewander merged 7 commits into
apache:masterfrom
bzp2010:feat-improve-pubsub
May 13, 2022
Merged

chore: improve the implementation of pubsub module#7043
spacewander merged 7 commits into
apache:masterfrom
bzp2010:feat-improve-pubsub

Conversation

@bzp2010

@bzp2010 bzp2010 commented May 13, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread apisix/core/pubsub.lua Outdated
-- @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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread apisix/core/pubsub.lua
-- @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
Copy Markdown
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
Copy Markdown
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