Re: PHP True Async RFC - Stage 2

From: Date: Sun, 16 Mar 2025 16:38:21 +0000
Subject: Re: PHP True Async RFC - Stage 2
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-126786@lists.php.net to get a copy of this message
Personally, i love the formal RFC for it's low level accessibility and this new RFC isn't that bad. The spawn keyword maybe the right keyword to use but it seems more weird, can we find another keyword to use other than that? Most languages i've seen make use of only the async/await keyword. Finally, is there any chance we might revise the formal RFC implementation?.. Nice work though :) On Sun, 16 Mar 2025, 4:36 pm Edmond Dantes, <edmond.ht@gmail.com> wrote: > Hello. > > > > > Just one quick question for now; why is suspend() a > > function and not > a statement? > > > > Yes, suspend() is a function from the Async namespace. > I couldn't find any strong reasons to define it as an operator: > ```php > suspend(); > // vs > suspend; > ``` > > For example, the spawn operator makes the code more expressive and > eliminates the need for closing parentheses. await here looks more like a > prefix for spawn. > > --- > Ed. >

« previous php.internals (#126786) next »