Re: PHP True Async RFC Stage 4

From: Date: Thu, 23 Oct 2025 08:24:52 +0000
Subject: Re: PHP True Async RFC Stage 4
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  Groups: php.internals 
Request: Send a blank email to internals+get-128927@lists.php.net to get a copy of this message

On Thu, Oct 23, 2025, at 10:04, Edmond Dantes wrote:
> > Nowhere in the RFC does it explain how await() applies to the Awaitable interface, it only
> > specifies it in the context of a coroutine.
> 
> Which aspect of the behavior is not described here?
> 
> RFC:
> 
> The Awaitable interface is a contract that allows objects to be used
> in the await expression.
> The Awaitable interface does not impose limitations on the number of
> state changes.
> In the general case, objects implementing the Awaitable interface can
> act as triggers — that is, they can change their state an unlimited
> number of times. This means that multiple calls to await <Awaitable>
> may produce different results.
> 

For example, it describes:

> await suspends the execution of the current coroutine until the awaited one
> returns a final result or completes with an exception.

But it doesn't explicitely say that it happens for Awaitable. For all we know, it doesn't
suspend anything unless the value given to it is a coroutine. Since Awaitable doesn't
necessarily have a "final result" or "a single exception" we know it isn't
about Awaitable, but about coroutines.

— Rob


Thread (104 messages)

« previous php.internals (#128927) next »