Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128930 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 56D651A00D1 for ; Thu, 23 Oct 2025 14:00:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761228009; bh=auZVCGcBuQdxoNCGGu180eVmDvIzdkPGz1BGV+Uuh/Y=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=XD8EbCnmH8o8bZwlkR3MnSp4jVfdhyA2yOuRzef3RJP/qkiBrN6Jj/po6UVt2NfUv fo3kXT2dnFLBVhY3HJFnNY3z9rGjNdHuUEZe7ZwQpNAk1A72edAafhjO151ir5qXXg qY4YEdT3hvzxFICl8bCWEuDqRSpjCqgekTY2MSPIMFkY5ujot/CcY4UEjUcV+H7fs6 xXBcZwmjJbbwdlhvK6TZIbq3lt8LCRNb4XN647YhFSEGvyJh71ccoRL3he7I+uyrbt cZ4uEWKi1IPE6w4swGvXqwgKJZ5wf+dJa4yObI34gWE+t5obhYjRLCyzrkUOkzQt6U vflYXBtRbmiQw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B4EA61801DF for ; Thu, 23 Oct 2025 14:00:07 +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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (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, 23 Oct 2025 14:00:06 +0000 (UTC) Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id F2F101D00155; Thu, 23 Oct 2025 09:59:59 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-05.internal (MEProxy); Thu, 23 Oct 2025 10:00:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm3; t=1761227999; x= 1761314399; bh=auZVCGcBuQdxoNCGGu180eVmDvIzdkPGz1BGV+Uuh/Y=; b=t JQOLfcN66lksxFJqCMlLZtHsyRnf+0LmHqfA/KgbuGpYGXdYMgNG1Hr0kyQB9I8p bnQMdxbYBJO+Po3UI6cdynSgJBZdMi4xJeQTJbn9iSP+MYnNa1ZiECdP4WmXhR3m zFiYFO9tamIzRIsXi0Gjvv8v2JBZqSTQDqqPhtucbpi3UEn6KVEGZuAKg17N9Jjb jKfu39fb3cRoGeeI6GyCQ/8AkkKcZXM+CEUI7a1ad8SsIHH4+iD2Cby4eos+7DVG XnCvMVLhJ6ZNVbtUgZUXujWoKEhL6EJMRhjJ1rhMcW2sqsu3ET1oePyei7z/IxHo b7mHREWPcLS54miR0MiwA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1761227999; x=1761314399; bh=auZVCGcBuQdxoNCGGu180eVmDvIzdkPGz1B GV+Uuh/Y=; b=JVfyKQpR9Y5e4lhCgPC536JgmDyU2g1NSmaNP3XF3/MXkr5g2Z7 Rpf9DcdDi/M7noT52STI4mGZHpp28/hn+Phq+WxQN33u4/tLMgJWMan5wKe07kFy AVHwLLNKSIdDYRQo0UYmUGdsI5Jtc027p6SeI5p5fAkoaT/AymYNte8eK0TjTYHQ TsR2IJh3YjaOt5rd+3IGobgYiVXUvrEfjn4a4T56UvDNlXFBcf65wEWa7xwj9VNK IwSLSGlq9HOp8b/1coK25JX6m1CQuH7OZ1Kd44b0RLUIaeSYWBthvl1vCXchwzvd 0p1hvMoRjonWvinV4olfDFFZFm/X87LW8Aw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddugeeiieegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgesrgdtreerredtjeenucfhrhhomhepfdftohgsucfn rghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrghtth gvrhhnpeeiueethedvvdefjefhgfeiheelheehtdfhfeekjefflefgvedvkeduteejjedt tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehroh gssegsohhtthhlvggurdgtohguvghspdhnsggprhgtphhtthhopeefpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopegvughmohhnugdrhhhtsehgmhgrihhlrdgtohhmpdhrtg hpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvthdprhgtphhtthho pegrrghrohhnsehtrhhofihskhhirdgtohhm X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 4E99F1820074; Thu, 23 Oct 2025 09:59:59 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AQpA1KTaY2GJ Date: Thu, 23 Oct 2025 15:59:39 +0200 To: "Edmond Dantes" Cc: "Aaron Piotrowski" , "PHP Internals" Message-ID: <16c8de59-3890-469c-b9f5-c43f94dc7a33@app.fastmail.com> In-Reply-To: References: <0e4e39d6-9cc9-4970-92e0-2463143b4011@app.fastmail.com> <37180d8d-85b4-49a3-a672-334bf4329470@app.fastmail.com> <2f8524a7-dea2-4fbf-933a-c538d3706253@app.fastmail.com> <151800a7-1094-49bc-8e43-c593a74741af@app.fastmail.com> Subject: Re: [PHP-DEV] PHP True Async RFC Stage 4 Content-Type: multipart/alternative; boundary=1efb19d09ed74f88b7cdc8b586f80d68 From: rob@bottled.codes ("Rob Landers") --1efb19d09ed74f88b7cdc8b586f80d68 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Oct 23, 2025, at 13:08, Edmond Dantes wrote: > Hello. >=20 > It seems to me that the following solution balances the different > viewpoints better: >=20 > 1. Keep the base `Awaitable` interface, which defines an object that > can be awaited. > 2. Introduce a `FutureLike` interface that extends `Awaitable`. > 3. Modify the `await()` function so that it only accepts `FutureLike` = objects. > 4. Functions such as `awaitAll` or `awaitAny` may need to be renamed, > but that=E2=80=99s outside the scope of this RFC. > 5. There will be no need to create a `Future` for functions designed > to work with an `Awaitable` object =E2=80=94 this keeps the `select ca= se` > syntax clean. >=20 > **Naming issue** >=20 > I see a certain inconsistency between `await` and `Awaitable`. > It might be worth coming up with a better name for `Awaitable`. > I remember that =E2=80=9CObservable=E2=80=9D was once suggested. >=20 Why not keep the name Awaitable instead of creating a FutureLike, but ju= st harden the interface? We can always loosen the interface in the futur= e, or create a new interface for "streaming" awaitables (aka, multi-shot= Awaitable). Then await() could change its signature from Async\await(Aw= aitable $awaitable): mixed to Async\await(Awaitable|StreamingAwaitable $= awaitable) at some point in the future -- and it would be BC. =E2=80=94 Rob --1efb19d09ed74f88b7cdc8b586f80d68 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Thu, Oct 23, 2025, at 13:08, Edmond Dantes wrote:
Hello.

It seems to me that the following solution balances the = different
viewpoints better:

1. Keep = the base `Awaitable` interface, which defines an object that
c= an be awaited.
2. Introduce a `FutureLike` interface that exte= nds `Awaitable`.
3. Modify the `await()` function so that it o= nly accepts `FutureLike` objects.
4. Functions such as `awaitA= ll` or `awaitAny` may need to be renamed,
but that=E2=80=99s o= utside the scope of this RFC.
5. There will be no need to crea= te a `Future` for functions designed
to work with an `Awaitabl= e` object =E2=80=94 this keeps the `select case`
syntax clean.=

**Naming issue**

I se= e a certain inconsistency between `await` and `Awaitable`.
It = might be worth coming up with a better name for `Awaitable`.
I= remember that =E2=80=9CObservable=E2=80=9D was once suggested.


Why not keep the name Await= able instead of creating a FutureLike, but just harden the interface? We= can always loosen the interface in the future, or create a new interfac= e for "streaming" awaitables (aka, multi-shot Awaitable). Then await() c= ould change its signature from Async\await(Awaitable $awaitable): mixed = to Async\await(Awaitable|StreamingAwaitable $awaitable) at some point in= the future -- and it would be BC.

=E2=80=94 Rob
--1efb19d09ed74f88b7cdc8b586f80d68--