On Mon, 2019-12-23 at 10:55 -0800, Stanislav Malyshev wrote: > Hi! > > > Does this actually fit in with php's execution model of each > > request > > being a separate thread / process? As far as I understand this kind > > of > > async programming is only useful within an event-loop architecture > > as > > used by nodejs for example. There are things that do this for php > > like > > We also have functionality in Curl and some DB drivers that could > execute several queries at once, in parallel, and gather the result. > Its essentially the same thing but applied to specific events. It may > make sense to generalize it - i.e. if you had some process like HTTP > request and you wanted to do curl_multi_exec() but in your code - > you'd probably want some way to easily do that...
There would be lots of value in a common framework for that. For a user it would be nice to send curl requests, database queries etc. and define the continuation routines in a common way, so that those things can be composed. > Not sure how to do technical details, > as I didn't think in depth about it, but by itself the concept does > not > contradict the PHP execution model... It is contrary in the sense that hack's approach depends on an event loop. This has impact on all code written. Alternative approaches are possible, like a future-based approach combined with a blocking wait, which gives the control to the user might fit more into PHP's current model. johannes -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php