Closed sxyazi closed 1 week ago
In practice, the severity of static messages has proven to be meaningless and increases protocol complexity.
severity
This PR replacing severity with sender to resolves https://github.com/sxyazi/yazi/pull/1004#discussion_r1596707396
sender
This PR removes the ps.pub_static() method and replaces it with ps.pub_to():
ps.pub_static()
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:
kind
@
ps.sub_remote()
- 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
ya pub
- ya pub-static 10 "greeting" --str "Hello, World!" + ya pub "@greeting" 0 --str "Hello, World!"
Need more tests to merge
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.
In practice, the
severity
of static messages has proven to be meaningless and increases protocol complexity.This PR replacing
severity
withsender
to resolves https://github.com/sxyazi/yazi/pull/1004#discussion_r1596707396⚠️ Breaking changes
This PR removes the
ps.pub_static()
method and replaces it withps.pub_to()
:Messages with a
kind
that starts with@
indicate they are static messages. Accordingly,ps.sub_remote()
subscribes to static messages using that kind:The
ya pub-static
command has also been removed and replaced withya pub
: