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

feat!: include the sender ID in static messages #1172

Merged
merged 3 commits into from
Jun 22, 2024
Merged

feat!: include the sender ID in static messages #1172

merged 3 commits into from
Jun 22, 2024

Conversation

sxyazi
Copy link
Owner

@sxyazi sxyazi commented Jun 20, 2024

In practice, the severity of static messages has proven to be meaningless and increases protocol complexity.

This PR replacing severity with sender to resolves #1004 (comment)

⚠️ Breaking changes

This PR removes the ps.pub_static() method and replaces it with ps.pub_to():

- ps.pub_static(10, "greeting", "Hello, World!")
+ ps.pub_to(0, "@greeting", "Hello, World!")

Messages with a kind that starts with @ indicate they are static messages. Accordingly, ps.sub_remote() subscribes to static messages using that kind:

- ps.sub_remote("greeting", function() end)
+ ps.sub_remote("@greeting", function() end)

The ya pub-static command has also been removed and replaced with ya pub:

- ya pub-static 10 "greeting" --str "Hello, World!"
+ ya pub "@greeting" 0 --str "Hello, World!"

@sxyazi
Copy link
Owner Author

sxyazi commented Jun 20, 2024

Need more tests to merge

@mikavilpas
Copy link
Contributor

Looks like a great idea, and this would be quite helpful in the neovim integration. I'll try to find time to do a proof of concept with this, maybe next week.

@sxyazi sxyazi merged commit 0c5d621 into main Jun 22, 2024
6 checks passed
@sxyazi sxyazi deleted the pr-b061d1ec branch June 22, 2024 17:34
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants