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

Implement MySqlConnection.CloseAsync #467

Closed
bgrainger opened this issue Mar 25, 2018 · 3 comments
Closed

Implement MySqlConnection.CloseAsync #467

bgrainger opened this issue Mar 25, 2018 · 3 comments
Assignees

Comments

@bgrainger
Copy link
Member

Connector/NET exposes a MySqlConnection.CloseAsync API (albeit implemented synchronously).

We could add the same API for clients who want to close the connection asynchronously; however note that in most cases this is just returning the connection to the pool, which is a synchronous operation (so CloseAsync would just add overhead).

@sazarubin
Copy link

sazarubin commented Jun 3, 2018

Since it isn't an asynchronous operation, is not part of ADO.NET DbConnection's interface, and is needed only for backwards compatibility with Connector/NET, I think CloseAsync is better to be implemented as an extension, maybe even in a separate package.

@bgrainger
Copy link
Member Author

(so CloseAsync would just add overhead).

This can mostly be avoided by not implementing it as an async method and instead just returning Task.CompletedTask.

@bgrainger
Copy link
Member Author

Added in 0.57.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants