Enforce with_max_clients at http handler - #249
Merged
Merged
Conversation
What's new: - Enforces `with_max_client` at http handler level by introducing `try_connection_guard` which implements a Compare And Swap on the atomic connection counter; - Updates `WsDispatch` and `WsSession` as they can no longer hold a `conn_guard` generated externally given current signagure; - Adds `with_max_subs_per_connection` to `WebSocketConnectorBuilder` which is now the real cap on subs per connection; - Adds test cases for the `with_max_client` cap featuring two scenarios: 1) clients sequentially connect; 2) clients concurrently connect
lxsaah
approved these changes
Sep 4, 2026
Contributor
|
Lgtm. Thanks @solus161 |
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.
Description
What's new:
with_max_clientat http handler level by introducingtry_connection_guardwhich implements a Compare And Swap on the atomic connection counter;WsDispatchandWsSessionas they can no longer hold aconn_guardgenerated externally given current signagure;with_max_subs_per_connectiontoWebSocketConnectorBuilderwhich is now the real cap on subs per connection;with_max_clientcap featuring two scenarios: 1) clients sequentially connect; 2) clients concurrently connectRelated Issue
Checklist
make check).