```php await $some with 5s; ``` Maybe
```php await $some limit 5s; ``` On Thu, Mar 20, 2025 at 9:33 AM Edmond Dantes <edmond...@gmail.com> wrote: > Hello everyone, > I’d like to ask for your help regarding the syntax. > > **Goal:** I want to get rid of the `BoundedScope` object while still > providing a convenient built-in tool for controlling wait time. > > To achieve this, we could extend the `await` expression so that it allows > explicitly specifying a limit. > For example: > > ```php > await $some with 5s; > ``` > > Or a more general approach: > ``` > [<resultExp> = ] await <AwaitExp> [bounded <CancellationExp>]; > ``` > > I’m concerned that no other programming language has a similar construct. > > On the other hand, if `Cancellation` is defined in a different way (not > through syntax), it requires a separate function. For example: > > ```php > await all([$task1, $task2], $cancellation); > ``` > > This approach is actually used in all other languages. > > My question is: Should cancellation have its own syntax, or should we > follow the conventional approach? > -- Iliya Miroslavov Iliev i.mirosla...@gmail.com