swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.46k stars 3.16k forks source link

Promise and yield #1392

Closed sinasalek closed 7 years ago

sinasalek commented 7 years ago

Is there any plan to use yield and promise to avoid callback hell in swoole?

doubaokun commented 7 years ago

Hi Sina,

Swoole 2.0 supports the built-in coroutine, and you can use fully synchronized code to implement asynchronous programs.

Please check the examples in the README file.

sinasalek commented 7 years ago

Thanks for the quick response, yes i knew about coroutines, but that still requires callback. is there a reason why you decided to use callbacks instead of yield or promise? also is there any technical documentation regarding how coroutines works?