-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Why is this package not based on mysqli? #94
Comments
mysqli_poll() is just polling ... mysql. It does not provide you any possibility to poll any other streams together with the mysql data. |
Thank you for the explanation! 👍 This makes perfectly sense now. |
@bwoebi am I right that MySQLi should some function like If so, it might be reasonable to propose missing functionality via RFC into PHP Core. IMO MySQL support is crucial for async support. In contrast with recently implemented Fibers, it might give opportunity for adopting Amp into projects via such popular DBALs like Doctrine. |
No, you are not right. The issue is at the protocol level. The mysql protocol does not allow for multiple queries executing at the same time on a single socket. Which why we are using connection pooling. |
@bwoebi one query per connection is fine, an exposed socket would still be useful to avoid the userland protocol implementation. |
@bwoebi the reason why I'm asking is that recently I've found that MySql 8 client library supports async queries: https://dev.mysql.com/doc/c-api/8.0/en/c-api-asynchronous-interface.html Does it might mean that MySQL protocol supports async queries now? |
Answering my previous question. Obviously, MySQL binary protocol is sync, so nothing changed, the C client just works with the connection pool. |
First of all I'm sorry as this is not really an issue, but I got curious and StackOverflow closed my question as off-topic, so I thought I'd ask here directly:
Why isn't amphp/mysql based on mysqli?
mysqli
supports async queries, so was there a reason why this library was not simply built of top ofmysqli
, instead of re-implementing the whole MySQL protocol?Thanks for your time!
The text was updated successfully, but these errors were encountered: