Re: [PHP-DEV] [RFC] Fibers

2021-03-03 Thread Aaron Piotrowski
> Hello again everyone! > > Based upon feedback both on this list and elsewhere, I’ve decided to remove > the FiberScheduler API from the fiber proposal. > > The FiberScheduler API greatly increased the complexity of the implementation > and the potential for edge cases that would need to be

Re: [PHP-DEV] [RFC] Fibers

2021-02-15 Thread Aaron Piotrowski
> On Feb 3, 2021, at 11:32 AM, Aaron Piotrowski wrote: > > >> On Jan 31, 2021, at 11:29 AM, Levi Morrison via internals >> wrote: >> >> I think it would probably be advantageous to have an observer that >> alerts interested parties when the fiber switches. This way we can >> avoid querying

Re: [PHP-DEV] [RFC] Fibers

2021-02-12 Thread Aaron Piotrowski
> On Feb 12, 2021, at 4:05 PM, Aaron Piotrowski wrote: > > The Fiber API would conflict or prevent async / await from being added to PHP > in the future. The two APIs can coexist and serve different purposes. > While probably obvious from the rest of the context of the email, for clarity,

Re: [PHP-DEV] [RFC] Fibers

2021-02-12 Thread Aaron Piotrowski
> On Feb 12, 2021, at 3:47 PM, Mark Randall wrote: > > On 12/02/2021 21:40, Aaron Piotrowski wrote: >> I would like to open voting for this RFC around the beginning of March, so >> please review the minimal API and provide any feedback soon. > > Removing the scheduler was likely a good plan,

Re: [PHP-DEV] [RFC] Fibers

2021-02-12 Thread Mark Randall
On 12/02/2021 21:40, Aaron Piotrowski wrote: I would like to open voting for this RFC around the beginning of March, so please review the minimal API and provide any feedback soon. Removing the scheduler was likely a good plan, but pretty please reconsider your future scope. It's going to

Re: [PHP-DEV] [RFC] Fibers

2021-02-12 Thread Aaron Piotrowski
> On Dec 17, 2020, at 10:30 AM, Aaron Piotrowski 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

Re: [PHP-DEV] [RFC] Fibers

2021-02-03 Thread Aaron Piotrowski
> On Feb 3, 2021, at 8:27 AM, Nikita Popov wrote: > > If you stick to the FiberScheduler concept, then you might want to consider > inverting the API. Right now you're basically using a standard Fiber API, > with the difference that suspend() accepts a FiberScheduler, which is > unintuitive to

Re: [PHP-DEV] [RFC] Fibers

2021-02-03 Thread Aaron Piotrowski
> On Jan 31, 2021, at 11:29 AM, Levi Morrison via internals > wrote: > > I think it would probably be advantageous to have an observer that > alerts interested parties when the fiber switches. This way we can > avoid querying the current fiber on every fcall. > Hi Levi, Yes, I agree and

Re: [PHP-DEV] [RFC] Fibers

2021-02-03 Thread twosee
> 2021年2月2日 上午11:04,tyson andre 写道: > > Hi Aaron Piotrowski, > >> 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

Re: [PHP-DEV] [RFC] Fibers

2021-02-03 Thread twosee
> 2020年12月18日 上午12:30,Aaron Piotrowski 写道: > > 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

Re: [PHP-DEV] [RFC] Fibers

2021-02-03 Thread Nikita Popov
On Tue, Feb 2, 2021 at 10:35 PM Niklas Keller wrote: > Hey Nikita, > > Thank you for the proposal. Ergonomics of async I/O in PHP certainly leave >> something to be desired right now, and improvements in this area are >> welcome. >> >> Despite your explanations in the RFC and this thread, I'm

Re: [PHP-DEV] [RFC] Fibers

2021-02-02 Thread Niklas Keller
Hey Nikita, Thank you for the proposal. Ergonomics of async I/O in PHP certainly leave > something to be desired right now, and improvements in this area are > welcome. > > Despite your explanations in the RFC and this thread, I'm still having a > hard time understanding the purpose of the

Re: [PHP-DEV] [RFC] Fibers

2021-02-02 Thread Nikita Popov
On Thu, Dec 17, 2020 at 5:30 PM Aaron Piotrowski 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

Re: [PHP-DEV] [RFC] Fibers

2021-02-01 Thread tyson andre
Hi Aaron Piotrowski, > 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

Re: [PHP-DEV] [RFC] Fibers

2021-01-31 Thread Levi Morrison via internals
On Sat, Jan 23, 2021 at 12:11 PM Aaron Piotrowski wrote: > > > > On Jan 18, 2021, at 8:59 AM, Benjamin Eberlei wrote: > > > > Hi Aaron, > > > > this is a very interesting and welcome piece of functionality. I have gone > > through the RFC a few times now, it have never thought about or worked

Re: [PHP-DEV] [RFC] Fibers

2021-01-23 Thread Aaron Piotrowski
> On Jan 18, 2021, at 8:59 AM, Benjamin Eberlei wrote: > > Hi Aaron, > > this is a very interesting and welcome piece of functionality. I have gone > through the RFC a few times now, it have never thought about or worked with > fibers before, additional feedback will be forthcoming once I

Re: [PHP-DEV] [RFC] Fibers

2021-01-18 Thread Benjamin Eberlei
On Thu, Dec 17, 2020 at 5:30 PM Aaron Piotrowski 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

Re: [PHP-DEV] [RFC] Fibers

2021-01-08 Thread Aaron Piotrowski
Hi Peter, > On Jan 8, 2021, at 3:03 AM, Peter Stalman wrote: > > I've been playing around with this for a bit, and I have some more questions. > I see you recently changed how the `FiberScheduler` works, making it `final` > and adding some "is" functions to match it more to a regular fiber. >

Re: [PHP-DEV] [RFC] Fibers

2021-01-08 Thread Peter Stalman
Hi again Aaron, I've been playing around with this for a bit, and I have some more questions. I see you recently changed how the `FiberScheduler` works, making it `final` and adding some "is" functions to match it more to a regular fiber. Since the `FiberScheduler` is itself also a fiber, why

Re: [PHP-DEV] [RFC] Fibers

2020-12-22 Thread Aaron Piotrowski
Hi Mike, > On Dec 21, 2020, at 7:38 PM, Mike Schinkel wrote: > > Would it be appropriate of me to ask for a section that discusses how that > might be done in user space in the RFC, at least with some simple > pseudo-code, or if is it non-trivial than a link to where it is discussed in >

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Mike Schinkel
> On Dec 21, 2020, at 6:53 PM, Aaron Piotrowski wrote: > >> On Dec 21, 2020, at 4:33 PM, Mike Schinkel > > wrote: >> >>> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski >> > wrote: >>> >>> Hello everyone! >>> >>> I would like to introduce

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread tyson andre
Hi Mike Schinkel, > This is interesting, and potentially very useful. >  > I am curious about how you propose access to shared memory across fibers?  > What will happen if two fibers try to update a $GLOBALS variable at the same > time?  Or a property of the same object?  How will developers

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Aaron Piotrowski
> On Dec 21, 2020, at 4:33 PM, Mike Schinkel wrote: > >> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski 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

Re: [PHP-DEV] [RFC] Fibers

2020-12-21 Thread Mike Schinkel
> On Dec 17, 2020, at 11:30 AM, Aaron Piotrowski 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

Re: [PHP-DEV] [RFC] Fibers

2020-12-17 Thread Aaron Piotrowski
> On Dec 17, 2020, at 4:11 PM, Saif Eddin Gmati wrote: > > Hello Aaron, > > First, I want to say that I love this proposal and would love to see it land > in the next PHP release, but I have one question regarding this: > > >> Promises result in the “What color is your function” problem as

Re: [PHP-DEV] [RFC] Fibers

2020-12-17 Thread Saif Eddin Gmati
Hello Aaron, First, I want to say that I love this proposal and would love to see it land in the next PHP release, but I have one question regarding this: > Promises result in the “What color is your function” problem as described in > the introduction of the RFC. Returning promises from

Re: [PHP-DEV] [RFC] Fibers

2020-12-17 Thread Aaron Piotrowski
Hi Peter, > On Dec 17, 2020, at 1:23 PM, Peter Stalman wrote: > > 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 >

Re: [PHP-DEV] [RFC] Fibers

2020-12-17 Thread Peter Stalman
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

[PHP-DEV] [RFC] Fibers

2020-12-17 Thread Aaron Piotrowski
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