Search code examples
phpmysqlmysqlireactphpamphp

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


I've seen that libraries such as amphp/mysql and friends-of-reactphp/mysql implement the low-level MySQL protocol, and do not rely on any built-in extension.

Given that mysqli supports async queries, is there any reason why these async libraries cannot be based on mysqli?

Originally asked as Why isn't amphp/mysql based on mysqli? (closed).


Solution

  • Hey ReactPHP core team member here. In short you shouldn't use them (you always can but we strongly advise against it) because their I/O isn't hooked into our event loop. Meaning it can block the entire loop and everything hooked into it until it's done with what ever it does.