> Can I mix sync IO and async IO in one function?

To be more precise, the idea is that ideally all input and output must
be non blocking and must work through an EventLoop. In that case an
application that performs I O often receives the maximum benefit from
coroutines. From the PHP process point of view the application is
always asynchronous. From the coroutine point of view it is
synchronous.

The thinking of a programmer who works with such code is different
from JavaScript. Here I do not think about which code will be
asynchronous, I think about how many functions I can run in the
background independently of each other. Because all code is already
asynchronous. The only question is how many virtual logical threads I
want to divide it into. This philosophy is better for business logic
code but worse for systems programming. That is why I chose it.

Reply via email to