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

[ws server]: add a way to limit the number of subscriptions per connection #729

Closed
niklasad1 opened this issue Apr 11, 2022 · 1 comment
Closed

Comments

@niklasad1
Copy link
Member

niklasad1 commented Apr 11, 2022

It would be good to a way to limit the number of subscriptions per connection.

A suggested approach is to wrap close_notify in a new type to get the strong count as it is increased by one for each subscription.

niklasad1 added a commit that referenced this issue Apr 26, 2022
niklasad1 added a commit that referenced this issue May 3, 2022
…739)

* feat: limit the number of subscriptions

Closing #729

* fix nit

* Update core/src/server/helpers.rs

* add integration tests + some fixes so it works

* cargo fmt

* fix doc links

* Unsubscribe calls should avoid subscription limits

Point to Tokio 1.16 (we use a method from it), and a little special treatment for unsubscribe methods

* No resource limiting for Unsubscribe calls

* Test that we can still unsubscribe after hitting a limit

* Fix a comment typo

Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>

* Update core/src/server/rpc_module.rs

* Update core/src/server/rpc_module.rs

Co-authored-by: James Wilson <james@jsdw.me>
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
@niklasad1
Copy link
Member Author

Closed by #739

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

No branches or pull requests

1 participant