Refactor to move command queue to MysqlClient
and connection logic to Connection
class
#190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changeset includes a major refactoring to move the command queue to the
MysqlClient
and the connection logic to theConnection
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