Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126855 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id A0F751A00BC for ; Thu, 20 Mar 2025 07:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1742455680; bh=0vWB0gDw4gtVGnqJIxIilHdi76IAG9lWHrq88+NTz2I=; h=References:In-Reply-To:From:Date:Subject:To:From; b=g0P3Sa/IdfgNUqFs/QRHRmxwcs4dBLbQzQkMuObiO9Cijj6hcg8wonijlsuRvjkjP G1S98/5RWzW/sWy1nkC0TvaZWrwOIbAKpPGJx6+/vhern7VpTvvETvZMk664Sigiro cwtClYHNF7BbrZkwdj+uwQShQacFVg4eHS0A7W23hQWWS+F903AZJtg54gjlQlPm80 z5HDs4+oqJysmulRGaBXTa7xS9PdBU/e/LvxpawWgb/4BVgeZ2k5mCSI0ptKD77tRX MEZkdUy78siPf7+pk2mtCgwGRCQMLud/ObE8bpLuqdgo9AaBd9qkB+JnOX+xbD3cN7 3liqSH02Vukjg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ACBCE1801D6 for ; Thu, 20 Mar 2025 07:27:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 20 Mar 2025 07:27:59 +0000 (UTC) Received: by mail-yb1-f180.google.com with SMTP id 3f1490d57ef6-e455bf1f4d3so314108276.2 for ; Thu, 20 Mar 2025 00:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742455829; x=1743060629; darn=lists.php.net; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=0vWB0gDw4gtVGnqJIxIilHdi76IAG9lWHrq88+NTz2I=; b=SPAAkfr5ERPmtnS9ElpLqGTF1xQMlXbzXjVEg3vWrY60MU86i7H2LvDC7aVxgDnzSd trAxYnKK/U9C14C1cCh6zy9X3fgZTeBcIQIRCGh3tbx6HxvWJaLcsDe6rGUGF8J1C7dS ZLCsAaG6ck84rP4uZHLtAv2inc6WwvP4kI7+O+a+F5Kkw2ReqQnfOBIOkRpXT3I4RWRD vGDJ3jF+5IKl5uYtpihW2wX6KvNPiJFM/9K+Lbw/lGhbuN+Ob/2wNBdnrr48riCIcuNn h+dianGvEPvAn4SxsByqPiah5pATHECCLRRjYVePEEjSXBy64ngW15JMUjXSQFHI8dow 5bXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742455829; x=1743060629; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0vWB0gDw4gtVGnqJIxIilHdi76IAG9lWHrq88+NTz2I=; b=tFHIM+/nF2UcZ437+r+BFsMEsc/Bm3anL5VFaJHfXUIKG9Pi+qe/KqgOTIi+CpKcYZ 40mP4wgWpHEcq/nFEG8TmUHMdbagTyM6E8NuKqcKUecs7vae7kx++kxyjU6CMqjbuwJ/ e9nJHknE1gqwHYpJAqct/x3ZEoLXDlq6P7VeMhIXSeGZ2NvBttwPXc24Fujgx6+Kdpva BXU2P+ekx453FQtJhL0qwbTZa3wHJrJ5EOSj+bblL6PYA7LGBguo9EWHBZmkMmY9KJPd s0ZrhOrQnEuLY/rP5wdhbQ76GFQ9bp1iCLRW8mk8mOOzpM3xIo3uGYJYCoO/JxMksWTr l+hQ== X-Gm-Message-State: AOJu0YxsxcweSeMjoeQxmJPD7cOcKhtPY+wlHKibkbuLuyekZX9h/IhH 0EJOV4XyS5Bdz67043oE6H3HQJYDh9etacqWUf+b6pO4o2m1VYEYSdbxIW8of/wM3QH4neFHcIX 9tvf0dSEaC4z1x1e5tKOcOvq5Fhha5p+Wn18= X-Gm-Gg: ASbGncs0wjVuLX/qeX3m3JNMd4wC6BLJJY6+ZKfLqAqHSW6u9uMFIHB7lWh+JvbJJNb +/EvZeb9IICcFE68cC3tuHOmmBQKgx/0t/pjTwMOpRxw6aR/NkMEPRplMElMQ0ggy8WbE0im+kc xX+HBiBvxGBAia1aRCDEy0qdneQA== X-Google-Smtp-Source: AGHT+IGcRzTGEDFCFBvQFUwjaaFhssUMCqDYcCYt5Z6fWW6JLO5XT+iEFEbjjIJMoAZ3uFF7G9Pa+fIXKNgtCjugimA= X-Received: by 2002:a05:6902:2101:b0:e5d:c5f3:13e1 with SMTP id 3f1490d57ef6-e66920e0a5amr3038905276.35.1742455829535; Thu, 20 Mar 2025 00:30:29 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 20 Mar 2025 09:30:19 +0200 X-Gm-Features: AQ5f1JpTMbJfYPP52IoK8u7EMEOV9CCWE2P9ieP_wMrRBM-qsM4C3DnRC2URxsM Message-ID: Subject: [PHP-DEV] Re: PHP True Async RFC - Stage 2 To: php internals Content-Type: multipart/alternative; boundary="000000000000c1a2880630c11cd0" From: edmond.ht@gmail.com (Edmond Dantes) --000000000000c1a2880630c11cd0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello everyone, I=E2=80=99d 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: ``` [ =3D ] await [bounded ]; ``` I=E2=80=99m concerned that no other programming language has a similar cons= truct. 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? --000000000000c1a2880630c11cd0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello everyone, =C2=A0
I=E2=80=99d like to ask for your= help regarding the syntax. =C2=A0

**Goal:** I want to get rid of th= e `BoundedScope` object while still providing a convenient built-in tool fo= r controlling wait time. =C2=A0

To achieve this, we could extend the= `await` expression so that it allows explicitly specifying a limit. =C2=A0=
For example: =C2=A0

```php
await $some with 5s;
```

Or a more general approach:=C2=A0=C2=A0
`= ``
[<resultExp> =3D ] await <AwaitExp> [bounded <C= ancellationExp>];
```

I=E2=80=99m= concerned that no other programming language has a similar construct. =C2= =A0

On the other hand, if `Cancellation` is defined in a different w= ay (not through syntax), it requires a separate function. For example: =C2= =A0

```php
await all([$task1, $task2], $cancellation);
<= div>```

This approach is actually used in all o= ther languages.

My question is: Should cancellation have its own syntax, or= should we follow the conventional approach?

--000000000000c1a2880630c11cd0--