Re: PHP True Async
| From: | Bilge | Date: | Mon, 17 Feb 2025 19:19:08 +0000 |
| Subject: | Re: PHP True Async | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126433@lists.php.net to get a copy of this message | ||
On 17/02/2025 18:53, Edmond Dantes wrote:
I forgot to mention this. There is an important *_limitation_* in how this solution behaves in the context of PHP. Calls to PHP functions that normally block execution in the zero-Fiber do not change their behavior. This solution has both advantages and disadvantages. The advantage is that it does not break *backward compatibility* in any way. Calling |sleep(10)| at the beginning of |<?php| will cause the process to go into a wait state. *True Async* changes the behavior of functions only if they are running inside a Fiber with an active Scheduler. This is yet another consequence of this architectural decision, and some people might not like it. However, at this point, I don’t see a better solution that would be optimally balanced between legacy support, explicit behavior, and implementation simplicity. Have a nice day! Ed. There should be no perceptible difference between a blocking sleep(10) and an async sleep(10), so what backwards compatibility are you referring to?Bilge