Why does swoole support both cooperation and async?

take mysql-client as an example. Swoole provides the following two ways

  • form of CoroutineMySQL, protocol
  • swoole_mysql, asynchronous form

Why does swoole offer both forms?

`swoole_server``swoole_http_server`

* `onRequet``onReceive``onConnect` 
* `onConnect``onReceive``onClose`

that"s not going to use asynchronous Mysql in onRequest.

Mar.30,2021

Synergy and asynchrony are not the same thing, you can learn about this. In addition, swoole collaboration programs are available only at the beginning of 2, and have existed before asynchrony.


Asynchronous implementation is early, and now it is mainly recommended to use co-programming

.
Menu