mysqli 是否存在使其不适合与 AMP 或 ReactPHP 一起使用的限制?

Are there limitations in mysqli that make it unsuitable for use with AMP or ReactPHP?

我看到 amphp/mysql and friends-of-reactphp/mysql 等库实现了低级 MySQL 协议,并且不依赖任何内置扩展。

鉴于mysqli supports async queries,这些异步库有什么理由不能基于mysqli

最初被问为 Why isn't amphp/mysql based on mysqli?(已关闭)。

礼貌 @bwoebi on amphp/mysql's GitHub:

mysqli_poll() is just polling... mysql. It does not provide you any possibility to poll any other streams together with the mysql data. There's no underlying file descriptors exposed by mysqli which the event loop could use.

嗨,这里是 ReactPHP 核心团队成员。简而言之,你不应该使用它们(你总是可以,但我们强烈建议不要使用)因为它们的 I/O 没有挂接到我们的事件循环中。这意味着它可以阻止整个循环和所有挂接到它的东西,直到它完成它所做的一切。