Hi Aaron, this is very interesting to me.  Can I ask why this approach as
opposed to other paradigms like promises, coroutines, etc?  You mentioned
async/await in the future scope, and I assume most of these patterns can be
implemented once there is an underlying functionality.  Basically, why
fibers instead of x?

You also mentioned this isn't really intended to be used directly, but with
a library such as AMPHP.  IS the expectation that non-blocking I/O
functionality like database drivers and file operation be provided by
libraries as well?

I hope I don't come off as critical, I am merely curious.  Thank you for
pushing this forward, as async is something PHP has been lacking and should
have IMO to compare favourably to other alternatives that do.

Regards, Peter.

On Thu, Dec 17, 2020 at 8:30 AM Aaron Piotrowski <aa...@trowski.com> wrote:

> Hello everyone!
>
> I would like to introduce an RFC for adding full-stack fibers to PHP:
> https://wiki.php.net/rfc/fibers
>
> Fibers are primarily used to implement green-threads or coroutines for
> asynchronous I/O. Fibers are similar to threads, except fibers exist within
> a single thread and require cooperative scheduling of the fibers by the
> process. Since fibers do not require a full CPU context switch, they are
> lightweight and more performant than multi-processing or threading for
> awaiting I/O.
>
> An implementation as an extension is at https://github.com/amphp/ext-fiber
>
> Fibers are a complex feature. The RFC contains many examples and links to
> code using fibers to help explain and demonstrate what is possible, however
> I’m certain many more questions and concerns will arise. Looking forward to
> feedback and discussion.
>
> Aaron Piotrowski
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: https://www.php.net/unsub.php
>
>

Reply via email to