On Tue., Mar. 16, 2021, 13:58 Josh Di Fabio, <joshdifa...@gmail.com> wrote:

> Fibers will not make those issues obvious at all. The issues I'm
> describing will only crop up spontaneously and under load.
>

Hi Josh,

Is this really that big of a concern though?  The issue will only be a
problem if it's run inside an event loop/scheduler that the concerned
library is compatible with.  In which case the developer should be well
aware of what is involved.

Otherwise, if the library uses fibers internally it will have to resolve
them itself before continuing, no?  If `capturePayment()` starts a fiber
then execution will not get to `setTransactionId()`, until it completed or
is handed of to a scheduler (again, which the developer would be aware of.

So I don't think developers will face this race condition, unless they are
using framework like amphp and reactphp.  But that's already the same now,
so if it's an issue it's not a new one with this RFC.

Your average unaware developer can continue to happily use any libraries
they want without encountering any async issues.  The calls from outside
the library will still be blocking, as PHP will still be single threaded.

Thanks,
Peter

Reply via email to