3 ms·
Like Fibers? https://www.php.net/manual/en/language.fibers.php https://www.php.net/manual/en/language.fibers.php
by blowski 5y ago
Like Fibers? https://www.php.net/manual/en/language.fibers.php https://www.php.net/manual/en/language.fibers.php
- kijin 5y agoFibers don't run concurrently with the main thread. They're like preemptive multitasking, not simultaneous multitasking. For example, if you have a long-running database query, disk I/O, or some other blocking function, you can't simply send it to the background and do something else while waiting for the result. Network requests are better, but only because the underlying functions support a rudimentary form of async calling.
- tored 5y agoSomeone has apparently implemented async library with fibers and stream wrappers. https://www.reddit.com/r/PHP/comments/u80gyg/true_coroutines_like_go/ https://www.reddit.com/r/PHP/comments/u80gyg/true_coroutines...