Skip to content

Use ConnectionLease to return connection #571

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fabianfett
Copy link
Collaborator

@fabianfett fabianfett commented Jul 18, 2025

This adds some functionality prototyped in #551. Passing a lease to the user, allows us to capture the pool, the connection came from. This ensures, we don't need to look for the pool the connection is from, when we release it.

@fabianfett fabianfett requested a review from gwynne as a code owner July 18, 2025 13:11
@fabianfett
Copy link
Collaborator Author

API break is expected:

3 breaking changes detected in _ConnectionPoolModule:
  💔 API breakage: func ConnectionRequestProtocol.complete(with:) has parameter 0 type change from Swift.Result<Self.Connection, _ConnectionPoolModule.ConnectionPoolError> to Swift.Result<_ConnectionPoolModule.ConnectionLease<Self.Connection>, _ConnectionPoolModule.ConnectionPoolError>
  💔 API breakage: func ConnectionPool.leaseConnection() has return type change from Connection to _ConnectionPoolModule.ConnectionLease<Connection>
  💔 API breakage: func ConnectionRequest.complete(with:) has parameter 0 type change from Swift.Result<Connection, _ConnectionPoolModule.ConnectionPoolError> to Swift.Result<_ConnectionPoolModule.ConnectionLease<Connection>, _ConnectionPoolModule.ConnectionPoolError>

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.

1 participant