Re: Re: PHP True Async RFC - Stage 2
| From: | Edmond Dantes | Date: | Thu, 20 Mar 2025 07:51:49 +0000 |
| Subject: | Re: Re: PHP True Async RFC - Stage 2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-126857@lists.php.net to get a copy of this message | ||
>
> await $some limit 5s;
>
Yes, limit is also a good keyword.
And some else examples with "until":
**CancellationExp**:
- A variable of the
Awaitable interface
```php
$cancellation = new Future();
$result = await $coroutine until $cancellation;
```
- A function that returns an Awaitable object
```php
function getCancellation(): \Async\Awaitable {
return new Future();
}
$result = await $coroutine until getCancellation();
```
- A new coroutine
```php
$result = await $coroutine until spawn sleep(5);
```