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

Refactor to move command queue to MysqlClient and connection logic to Connection class #190

Merged
merged 3 commits into from
Dec 5, 2023

Conversation

clue
Copy link
Contributor

@clue clue commented Dec 3, 2023

This changeset includes a major refactoring to move the command queue to the MysqlClient and the connection logic to the Connection class. This is specifically done to prepare the underlying classes and APIs to add support for multiple connections (connection pooling as discussed in #175) in a follow-up PR.

This changeset includes a large number of additional test cases to ensure this works as expected and should not otherwise affect any of our public APIs in any way, as confirmed by the existing functional tests. The affected code now has 100% test coverage through additional unit tests, most of which was only covered in functional tests previously. I've tried hard to avoid introducing any unneeded changes and keep as much as possible of the given structure, considering this changeset affects a substantial part of our APIs already. A follow-up PR should clean up the test suite, reorder some of the tests and update the functional test suite to omit the functional tests when no MYSQL_URI is given.

I think this might very well be one of the largest refactorings in ReactPHP recently. Just for the code changes alone you're already looking at several full days of work, plus countless sessions to discuss various approaches (thanks to @SimonFrings and @yadaiio!), enjoy! Special thanks to our sponsors for making this possible! If you'd like to support this development, consider sponsoring ReactPHP! ❤️

Refs #175 and #147
Builds on top of #189 and #186

@clue clue added this to the v0.7.0 milestone Dec 3, 2023
src/MysqlClient.php Show resolved Hide resolved
@WyriHaximus WyriHaximus merged commit 3cf70c6 into friends-of-reactphp:0.7.x Dec 5, 2023
13 checks passed
@clue clue deleted the good-connection branch December 6, 2023 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants