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: add a way to limit the number of subscriptions per connection #739

Merged
merged 13 commits into from
May 3, 2022

Conversation

niklasad1
Copy link
Member

Closing #729

core/src/server/helpers.rs Outdated Show resolved Hide resolved
/// Wrapper over [`tokio::sync::Notify`] with bounds check.
#[derive(Debug)]
pub struct BoundedSubscriptions {
inner: Arc<Notify>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether we need the Arc here? What would happen if we ditched it?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we use it to count notifies too; I see!

Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Would be good to have an integration test that it works :)

@niklasad1 niklasad1 marked this pull request as ready for review April 30, 2022 08:51
@niklasad1 niklasad1 requested a review from a team as a code owner April 30, 2022 08:51
core/src/server/rpc_module.rs Outdated Show resolved Hide resolved
Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com>
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