Re: [RFC] Fiber support (again)

From: Date: Sat, 10 Feb 2018 14:49:01 +0000
Subject: Re: [RFC] Fiber support (again)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-101820@lists.php.net to get a copy of this message
> Hi, all, > > I have updated the RFC https://wiki.php.net/rfc/fiber > > changes list: > > - introduce the throw(Exception $exceptin) API > - record issues discussed What about my suggestion of making PHP's main() automatically a Fiber, which avoids Fiber::yield() being used outside of a Fiber, because everything is a Fiber? This would require another continuation mechanism, as nothing has access to the automatically created main()-Fiber otherwise. There would also need to be something that stops the script execution as soon as there's no non-suspended Fiber anymore. Regarding the internal calls: A core dump / segfault in case of Fiber::yield() inside an internal function is unacceptable. It doesn't give the user any clue what's wrong. Instead, an exception could be thrown from Fiber::yield(), which just bubbles up then. Full support for internal functions could be added at a later point then. Regards, Niklas

« previous php.internals (#101820) next »