Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128856 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 lists.php.net (Postfix) with ESMTPS id D23181A00BC for ; Thu, 16 Oct 2025 15:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1760629592; bh=A3ty1PqJ6GZze82DVIOpSxeToXFGan7f4x0UTPMgNq8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Lu8BZ0aGhQ7ztvuDKsUpwXJkG73PQP561Td/ESqqZnp4FuPbzMvRCiSmBhDP4xKC4 L1FHKa662eG38RPG16zv1MuCRSGznPBl0Og+F4xWsJH6S2gdKRoXu2CsrWXF9DGNM4 2T0ryQM9362Qd7QvxUkjmDIGz/Rv2GGLV/PSsMCdHtJK+e3PNih5h8aPapQXCmEboP 9j2HgXSGozAftV+cFN5Q5GibNeYCldnwGBQ0/18XscqCQA+Dh/rPMqx1b/Q0JYtuPU KAsdmpc9ry+1kgibzGC5pi8UmvPjjEVLKfnV++Dr6ELOJwzlHONl1WEMhwGcgSJNH/ QqG+9YFdrqo2w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A3DBA180084 for ; Thu, 16 Oct 2025 15:46:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) (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, 16 Oct 2025 15:46:31 +0000 (UTC) Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-54bd3158f7bso647380e0c.0 for ; Thu, 16 Oct 2025 08:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760629586; x=1761234386; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A3ty1PqJ6GZze82DVIOpSxeToXFGan7f4x0UTPMgNq8=; b=OPurrwkTUmsZEBioA/1eJuaGLFkcT2iJmLymhQJm2UIrIibkcbW4s3g1ORNqRqM3sz v6jXb9c8VBOFED7E9+r6ATgxbGx6uklEx4ZwmjAWhHZwagO3FC3hAD1Pi3L1fE8lImok PxCPlgQ3ZJI72SQYH0/i7xnqXyAsTGG0Ni0Efi775wFbCHOm78Su7JB45Org/aVqeQY7 99vk7WFTiA0q+rOl3FaZ5KrujBpULamN3YtWeOMOdEeZ2l62cI58r61tTAuvDA4ml54O s8/8JilNH+VFodI4In2q8Elp69H/b3Cvb7bzbC8+LK9XPwFHxUcQYWk6r5jzLEz7seba OPcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760629586; x=1761234386; h=content-transfer-encoding:cc: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=A3ty1PqJ6GZze82DVIOpSxeToXFGan7f4x0UTPMgNq8=; b=qZRB2KjrNIJ9J6XvQ328hKdDLsIxxlUlFuEQHfJjfIsL4fc0yHf59GTP/UYgC1zbwW MyAcdQ1uZmpx0AYy9A5W44zmQbdw7b2h1z4OGEiL1S1/e1DHM9m6rX3qXEZc8QPAmPS/ EmpApcWRyzMJDl8VG+1BeqQlNl1q5+Akk19nvkvByIes4/CxVjuadBELLT5Ho9JYlLP6 QEFwkWBsbLqoo08CCRJ4laah1WF3C3G1jr/3Diw/Lr/frMdY5e/X63a+5JsSVA38Rrai 9sY7gymuSRdjYkm5JGKp/sJkpHDXJasPlhhRC0qEWhrzFtc67Eht1IczPtSJuEzWbCoS gtMQ== X-Gm-Message-State: AOJu0YxgtLF773sAWd3NTzD3rn8cw8Ygfe01v1xlRbMkSERVCskeBxGw ekYQSW1UKvNGaSFrKJVdoOYS+5pksCR7fZrvM/gXfpinIM2mUhdoLzJbsE6icMROoJhXHOCx9OD 5aa3q8SKlvDuLMz0AsKz3nDWixoT4Cek= X-Gm-Gg: ASbGncvurpBFqMzZHuMQdbxx4jVMrDaWrAlZgGlAL8hUTdEr01BnevY3mfthqnuTp/7 sNQ1tISuOvS9iuihNlHj93ofD2qdEdOQzLdfMSsBO+foyjZEJmH+YiccE+SzLfW5C6IQRLbGB/f 8/s7AnCzgMp/gKVJV23d/Njvr6jGKI/UaxEWlK/JhrjlDZzuZwqcgHyT7hRTEDU9/duB34JM2Fh 2cdvO12Lcr0IIdaoBgDmMPVKxehlDYZkrDfZ5PlEbYyZIX8ZaYBhFLILOw5Fr/TkZWPRuH3Buoy 1c25NhlYRtQ6e9o= X-Google-Smtp-Source: AGHT+IGKEKRigacFiAhH16foFjDPwKNUr9bfOlN/22OETGtKSZ/Dih3j2CRTWV9CP/PkQqykeHAy9oa6gQtnUxQ7+To= X-Received: by 2002:a05:6102:3f16:b0:5d5:f786:1eb4 with SMTP id ada2fe7eead31-5d7dd466857mr401662137.13.1760629585529; Thu, 16 Oct 2025 08:46:25 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <2b9fd3ec-50ca-41e4-985a-274f886df8b3@app.fastmail.com> <2e39e211-c816-41db-a079-f2c6b3934e0a@app.fastmail.com> <436d4ede-c08e-4e7d-9ae2-8342f7f827ed@app.fastmail.com> In-Reply-To: Date: Thu, 16 Oct 2025 18:46:13 +0300 X-Gm-Features: AS18NWCM7zMeue4kkAYzM6aCaZXPPX8HqHkrpHIa29zZuOKwz2156vTIztZeY_o Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC Stage 4 To: Rob Landers Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) > That contradiction encourages people to wrap it to =E2=80=9Cmake it await= able,=E2=80=9D which re-introduces the very problem you=E2=80=99re trying t= o avoid. Hm... > Renaming it to something like joinAll() or joinAfterCancellation() keeps = the semantics intact while communicating the intent: this isn=E2=80=99t a f= uture; it=E2=80=99s a container join. > That small change would make the interface self-documenting and harder to= misuse. There=E2=80=99s also an issue with the method name. The `awaitCompletion` method waits not for the Scope to close, but for all tasks to complete. That=E2=80=99s not the same thing. Maybe `joinAll` really is better, since it resembles the way threads are expected to work? But does `joinAll` fully reflect the meaning? After all, it=E2=80=99s not about waiting for *all* tasks in general, but only for those that exist while the function is active. That=E2=80=99s a very important distinction. Because in addition to this function, there could also be something like `awaitFinally` or similar. > That's what we are here to do, no? Discussion is useful if it makes thing= s better than the sum of their parts. Typically, when developers start medium or large projects, they begin with the key components intentionally leaving out details that can be easily changed later. There=E2=80=99s definitely something to discuss here, but is it really wort= h doing it *right now*? :) > // Looks innocent, but this can wait on foreign work: > $scope->awaitCompletion(Async\timeout(60000)); // rename -> joinAll(...)? If the developer wanted to start a task and limit its execution time, the code looks fine. And I would add a `try/catch` to handle errors. > My point is that it wasn't listed in "future scope" of the RFC, though th= ey're mentioned throughout the document, in passing. Yes, that was done intentionally on the advice of the PHP Team.