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

Add ws/robust, an alternative to ws_manager #49

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

abrkn
Copy link
Contributor

@abrkn abrkn commented Aug 16, 2024

This alternative to ws_manager with some improvements:

  • The stream is not coupled to the InfoClient
  • Subscriptions management is separated from the stream
  • Subscriptions are dropped when the token is dropped
  • The stream can be closed and does not leave dangling futures

It does not implement connection retries since this should be built on top as it requires informing subscribers that the stream is interrupted and the client is missing messages.

TODO

  • Helper on Subs to create a Stream and Subs with one fn call

@abrkn
Copy link
Contributor Author

abrkn commented Aug 16, 2024

This is my first time writing a Rust lib. Any feedback would be welcome!

I'll be testing the lib myself in the coming weeks and expect lots of changes based on that, hence leaving this PR as a draft.

@abrkn abrkn force-pushed the robust-stream branch 2 times, most recently from cfe3a0b to 3e27c2c Compare September 13, 2024 13:50
This alternative to ws_manager with some improvements:

- The stream is not coupled to the InfoClient
- Subscriptions management is separated from the stream
- Subscriptions are dropped when the token is dropped
- The stream can be closed and does not leave dangling futures

It does not implement connection retries since this should be built
on top as it requires informing subscribers that the stream is
interrupted and the client is missing messages.
@lmlmt
Copy link
Contributor

lmlmt commented Nov 12, 2024

@abrkn What's the status of this pull request? It's still marked as a draft but is it ready for review?

@abrkn
Copy link
Contributor Author

abrkn commented Nov 14, 2024

@abrkn What's the status of this pull request? It's still marked as a draft but is it ready for review?

i've been using the code in production for some time and i'm very happy with it. i'll do some rebasing and mark it ready for review. if the changes are too drastic, an alternate approach is exposing the types of this crate as pub and releasing this PR as a stand-alone crate

@Frixoe
Copy link
Contributor

Frixoe commented Nov 20, 2024

@abrkn can't you expose the additional features via a crate feature? I can assist in this effort if you want.

Essentially create a "enhanced-ws" or a similar feature name for all the new changes. This way you can modify existing functionality(building on this sdk) and add your own functionality.

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