Add support for topic subscribing via WebSockets (#17)#18
Open
corentincam wants to merge 6 commits intoshadowylab:masterfrom
Open
Add support for topic subscribing via WebSockets (#17)#18corentincam wants to merge 6 commits intoshadowylab:masterfrom
corentincam wants to merge 6 commits intoshadowylab:masterfrom
Conversation
6920fac to
68f4c40
Compare
yukibtc
requested changes
Mar 12, 2026
Member
yukibtc
left a comment
There was a problem hiding this comment.
Thanks @corentincam
I've marked few changes to do.
b5702ab to
c4c5f7b
Compare
c4c5f7b to
f042359
Compare
f042359 to
976ea19
Compare
Author
|
About the subscribing/proxy conflict, I decided to add a That way the checks can work with all features enabled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is my (successful) attempt at adding support for topic subscribing (blocking and async).
I added separate features as it adds some dependencies and I guess most people will use this lib to publish messages, not receive them.
Also, I added async-std and tokio features as async-tungstenite has them and we need to choose which module to use according to the async provider.
I'm sure this part could be better but my knowledge of async rust is not huge so don't hesitate to tell me if there's a better way.
Another thing: I couldn't add proxy support easily (see this and this), so I decided to make subscribing and socks features incompatible. Although they technically can be activated altogether, I don't want users to think proxy will work when subscribing to topics (even though there's no API for proxy in subscribers).
Those two last points break the checks with all features, I'm not sure how to resolve that.
I also took the liberty of adding a
.rustfmt.tomlfile because my editor kept reordering imports on save, I can remove it if you don't want it.