You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to once again express my gratitude to all the developers of this project. Thanks to your code, I have learned a lot about implementing asynchronous programming. I really appreciate the efficient approach to creating fibers. It's awesome!
However, I am unpleasantly surprised by what is happening at the PHP language level.
PHP has fibers, and that was a significant change, but not sufficient.
For the language to fully support asynchronous programming, an API is needed.
An API is needed that would allow transferring control from the fiber context to the scheduler.
For example, let's assume the code uses a PHP function like socket read/write. At the moment of invocation, this function could determine whether it is being executed inside a fiber. If so, it immediately passes its I/O descriptor, additional options, and invokes the scheduler.
The Scheduler API then transfers control to code that decides how to proceed with context switching, which objects to wait for, and so on.
PHP already has a similar implementation at the Zend level—Swoole—which uses hooks to override the behavior of standard functions.
But why hasn’t this been standardized yet? Such an API would save time when creating libraries, avoiding the need to clone PDO and similar tools.
Thank you once again for your contribution.
The text was updated successfully, but these errors were encountered:
Good day,
I would like to once again express my gratitude to all the developers of this project. Thanks to your code, I have learned a lot about implementing asynchronous programming. I really appreciate the efficient approach to creating fibers. It's awesome!
However, I am unpleasantly surprised by what is happening at the PHP language level.
PHP has fibers, and that was a significant change, but not sufficient.
For the language to fully support asynchronous programming, an API is needed.
An API is needed that would allow transferring control from the fiber context to the scheduler.
For example, let's assume the code uses a PHP function like socket read/write. At the moment of invocation, this function could determine whether it is being executed inside a fiber. If so, it immediately passes its I/O descriptor, additional options, and invokes the scheduler.
The Scheduler API then transfers control to code that decides how to proceed with context switching, which objects to wait for, and so on.
PHP already has a similar implementation at the Zend level—Swoole—which uses hooks to override the behavior of standard functions.
But why hasn’t this been standardized yet? Such an API would save time when creating libraries, avoiding the need to clone PDO and similar tools.
Thank you once again for your contribution.
The text was updated successfully, but these errors were encountered: