Re: [VOTE] True Async RFC 1.6

From: Date: Sat, 22 Nov 2025 12:01:09 +0000
Subject: Re: [VOTE] True Async RFC 1.6
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  Groups: php.internals 
Request: Send a blank email to internals+get-129389@lists.php.net to get a copy of this message
Hello

> function return types should not depend on the outside context (spawn, hook, ini, etc.) because
> when the code gets more complex, it's very hard to find the outside context.

What does “outside context” mean?

I just want to understand the practical use of functions with Promise.
The code above makes sense only if there is awaitAll.

$promise1 = file_get_content_async("file1.txt");
$promise2 = file_get_content_async("file2.txt");
$promise3 = file_get_content_async("file3.txt");

awaitAll($promise1, ....);

But you can achieve exactly the same effect without special functions.
The only difference is that the _async function inside might be
optimized in some way.
Or is there something else?

---
Ed


Thread (106 messages)

« previous php.internals (#129389) next »