asyncer-io / r2dbc-mysql

Reactive Relational Database Connectivity for MySQL. The official successor to mirromutth/r2dbc-mysql(dev.miku:r2dbc-mysql).
https://r2dbc.io
Apache License 2.0
195 stars 21 forks source link

Implemented Closeable in MySqlConnectionFactory #111

Closed svats0001 closed 1 year ago

svats0001 commented 1 year ago

@jchrys #66

I added support for the Closeable interface in MySqlConnectionFactory and I also removed the invocation of the deprecated getSocketTimeout() and replaced it with null in MySqlConnectionFactory. Let me know if there are any problems in the code.

Motivation: MySqlConnectionFactory could benefit from a way to release its resources through implementing the Closeable interface.

Modification: MySqlConnectionFactory now implements Closeable and contains the close() method that will remove the reference to the connection publisher. I removed the final keyword from the client reference so that it can be reassigned. I removed the configuration.getSocketTimeout() parameter from Client.connect in the from() method and replaced it with null.

Result: MySqlConnectionFactory now has a way for users to release its resources.