Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128854 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 464901A00BC for ; Thu, 16 Oct 2025 13:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1760620814; bh=TJHpNPaibPCyYfIt30QFAKW+yA+QxxQJf/3Mb+2EGL4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZMaGRcLGGwrUzjj5D6DkPN0J5ikxeo+41AHH4ArqsMFtL2tHyappT1FV+3b2NVjXF FoNGC/UNlIyrIkQykr1rBWOCcrkKF1vaWQVrlXL6+3RiABAH1gwCl50A7rXAYpgKYn JuKE4uUmpWotF0ubeGqFbAm3VSj6RG6bRqDfNBI1SZljPwEi9/ia8bhGRC5nH605TH v4QhMoQUW4zZ/MYa00CmjZfzLQlQslQoiAJ7nIH4FLXvy2UuqSl5Uis0EWx1reoIe9 1hg0IX+SVgdIJXhXCQr4E02BgUeeZ2qnK831iNuBimVHpgjm+Fi++SBFS/y8LqheWt EiDydSBVAPRzg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2C9FF180078 for ; Thu, 16 Oct 2025 13:20:10 +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,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f53.google.com (mail-ua1-f53.google.com [209.85.222.53]) (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 13:20:09 +0000 (UTC) Received: by mail-ua1-f53.google.com with SMTP id a1e0cc1a2514c-9231a251c01so202743241.1 for ; Thu, 16 Oct 2025 06:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1760620804; x=1761225604; 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=TJHpNPaibPCyYfIt30QFAKW+yA+QxxQJf/3Mb+2EGL4=; b=mNzd3a4LHKYuexfisFMtYnMcB/a6Fce0KEE2UPlwaLaUq/LT2oYU2kq8MMHW584nPW i5DMCwE0FCMTMEvfrPaHNXOtNF3Gy3G63xc99Wi3gKsN34nLl1vvIzE5ta/ncmpJ0VNe ISV4RnHLhtxO/2Uf5h7Glk4DlyF9z1Vl/zNUcY0qBEzaiSOG63WDSOyBp1B/I0Y9ODRt DJzH1TX6r3HvFy7xDmcCciuWMkJVMPA7mflBe+vjrz3tgmiBoXm2X2V9bbTWVHHjoWgI Uy+D1WeFpQly2rZyKqjNCtYkBkS8qS+bVaTs8HtUW+HEJgX2wFDLnLGQiQSOO71lTBKB +X9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760620804; x=1761225604; 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=TJHpNPaibPCyYfIt30QFAKW+yA+QxxQJf/3Mb+2EGL4=; b=alrxdm76ditpMn/dBU8eyvaJmNypD5rOsIn1JvH0ftq+wFyiHG1UkzFofTFhm/aX03 +5ceFotpqB+WwhhOuWtFTjdD7bQd3CwcEDG/8FoCyawJnowG2QuulsVXhPhJQCngzBnu kaoDJA7HXbOL7X/T0zo2kWfzBp4FImVX/b5fvrEq3KYTAV8Rl3zC+CldCqG0Hd2q+oW/ NpPIoYME8uThFJJcjDHaSi9EyBG1NpOCw1KfYpCsmD4fPo5ZUSkPNEwHvWWOftYDbjtr K0xGywWPDg4SP37W4mtjlNpJp0fbRX/ZYgBp85zEskUSXBxGLOXukuZofXftIlFj25MG mm5Q== X-Gm-Message-State: AOJu0YwzcWVZ7QpSF6YbjCThzRDXc+nel9OV2qhqRsKIOy+vDERSNptV CmKNRJJB+D6nIlbeMKJg1ETVIRzrZxR5c0wQrNhdYJAZY6nRjbaBb6ryw1pRDOx4tsm3ksP2Z9r 9gNEW4mhb30n7GSFx0YVCYw1GR3F/oy6l2c4N/Y4= X-Gm-Gg: ASbGncuZDouQ7UATFI3gK3fRwO9q3rO7SmC8gdudIpXTg+FOSbT+tY0enIRkZnIarVH 3Btn99NZ28vY6NcxHXK/DBJv+pob9+AdXnCAFk1a6DsiIEjyr8fRfOdvbSNvWDLoYeqKVK8gQ51 wu8IhdpxTBMcZlKIwIXOhilg6G5yoVQ3s235ZwH2/CvmdRlQP5I+fkHNf0na3TbbiJ4aLPacdKC Ppdw2HRw//H5CHRpMksKQnBCB/4FU1zvKpG/qZhBCIDP0vjUAA4hol/yjv9AEM6u1PYRXn3mye7 0BlpQeB83lqKJlK71q+KkTiozA== X-Google-Smtp-Source: AGHT+IFz47/krxsqnKnZ9HH6IZoieHTD2pmfTaMAJSnxhld3LVyU45An2Pn4aIP3pmklmHc79pbXpzm0bR3ndRNVmhs= X-Received: by 2002:a05:6102:e12:b0:5d6:155c:33aa with SMTP id ada2fe7eead31-5d7dd595ebemr110417137.16.1760620803817; Thu, 16 Oct 2025 06:20:03 -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: <436d4ede-c08e-4e7d-9ae2-8342f7f827ed@app.fastmail.com> Date: Thu, 16 Oct 2025 16:19:52 +0300 X-Gm-Features: AS18NWByhBPME7tiEALp5v5RtPfCM8GrRCEG7EzuBvo7mukL49K2DwnLhJ76zJ8 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) > Would it be better to instead of having ->awaitCompletion (which feels li= ke an implicit implementation of Awaitable without an explicit implmentatio= n -- which is the part that was bothering me), maybe having something like = ->joinAll() or ->joinOnCancellation()? > That way someone like me won't come along and wrap them in an Awaitable b= ecause it looks Awaitable. For example, you have an interface `DataBaseAdmin` with a `removeDB()` method and a class that implements it. You need to be able to delete the database, but with an additional condition. So you create a decorator class with a method `ContextualDBAdmin::removeDBWhen($extraRules)`. As a result, the decorator class is logically associated with the `DataBaseAdmin` interface. The question is: **so what?** > It also might be a good idea to make specifying a timeout in ms mandatory= , instead of a taking an Awaitable/Cancellation. The idea is correct, but there will definitely be someone who says they need more flexibility. And it's true you can create a `DeferredCancellation` and forget to finish it. :) There are a lot of such subtle points, and they can be discussed endlessly. But I wouldn=E2=80=99t spend time on them. > It also might be good to provide a realistic looking example showing a "b= ad case" of how this is dangerous instead of simply saying that it is, show= ing how a scope is not a 'future', > but a container, and preemptively mention TaskGroups, linking to the futu= re scope (which it should also probably be listed there as well). 1. It=E2=80=99s very difficult to write a realistic example that=E2=80=99s = still small. 2. The `TaskGroup` or `CoroutineGroup` class is left for future discussion. In the final documentation, it will be exactly as you suggested.