r2dbc-mysql
r2dbc-mysql copied to clipboard
Support opitonal Closeable interface for other stateful objects
While Connection already implements Closeable as a mandatory part of R2DBC, other stateful objects such as ConnectionFactory could benefit from providing a way to release their resources through implementing the Closeable interface.
This is an optional feature, so it is not mandatory to implement it according to the R2DBC specification.
However, it would be useful for those who need to manually close their resources without blocking the caller.
refer: https://r2dbc.io/spec/1.0.0.RELEASE/spec/html/#closeable
IMO, the MySQLConnectionFactory isn't a stateful object event if it contains a client (Mono type).
But I'm willing to refactor it to make the method MySqlConnectionFactory#create clearer.
@JohnNiang
Thanks for your thoughts, that make sense.
If you have a refactoring approach in mind to make MySqlConnectionFactory#create clearer, I’d love to see it!