-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: remove connection pooling
This is a significant breaking change to the library's behaviour. In particular: - Methods on `Endpoint` to remove or fetch connections from the connection pool have been removed. - All connection-returning methods on `Endpoint` will always return a new connection (on success). - Connections are not held open automatically. If the `IncomingConnections` struct is dropped when creating an `Endpoint`, any connections handled by the endpoint will be dropped immediately (in future this should probably drop the underlying `quinn::Incoming` as well, meaning connections will be rejected outright). The upshot of this is change is that it's now necessary for callers to apply their own resource management for connection handles. A naive migration would likely lead to many more connections being made, which could be detrimental to performance. However, this simplifies `qp2p` and removes a lot of edge-cases, and is expected to be removing a lot of undiscovered bugs. Callers can now use a connection management strategy that makes the most sense for them, which is likely to be much simpler than the general-purpose approach that had to be taken here. BREAKING CHANGE: - The `ConnId` trait has been removed. - `Endpoint`, `IncomingConnections`, `Connection`, and `ConnectionIncoming` no longer have a generic type parameter. - `Endpoint::disconnect_from`, `Endpoint::get_connection_by_addr`, and `Endpoint::get_connection_by_id` have been removed. - `Connection::id` has been removed. - `Endpoint::new`, `Endpoint::connect_to`, and `Endpoint::connect_to_any` now return `(Connection, ConnectionIncoming)`, rather than `(Connection, Option<ConnectionIncoming>)`. - `Connection::open_bi` no longer takes a `priority` argument. This can be set with `SendStream::set_priority` instead. - Semantically, all calls to `Endpoint::connect_to` and `Endpoint::connect_to_any` will establish and return new connections. There is no connection reuse.
- Loading branch information
Showing
10 changed files
with
154 additions
and
771 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.