Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126627 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 A5C871A00BC for ; Fri, 7 Mar 2025 23:21:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741389522; bh=ykfsEFZI4CddGuLsY15LMltlvdhFBSeI/0Drz+jcOZs=; h=Date:Subject:To:References:From:In-Reply-To:From; b=PKhcePvyZWhRX89MZVLFM+CL8LimtoZNmHn1O7VVYycpwufFqqUVSHaj+5oGDrLG7 OyQCifnA28wriblTuBFAEvAGoZ5piUGJYrbNZlhV+4MIunXMiyLeYCzysXN+/QVwFM VEZ05v1/X4BmoGTtOnjic0TYE8qBpEhkhjfY16s4pyO7FKhRpBoyxJSlmeQU2A5QN6 NU1LwhMQjQTxbJWoabdRZHJgL7aT6Qp4c0J3JlxRuz/HnF8YF+t1O0ZY+PzHfi+WH1 wwx1qP0tPfNgWiuPnPBpNSndGF6ewaR1+0Kjoy8TDBhPX+a5MeP92t0szJtjvMkw5H 5VY6t47/QRbvA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 55F9A18004B for ; Fri, 7 Mar 2025 23:18:41 +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=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-b8-smtp.messagingengine.com (fout-b8-smtp.messagingengine.com [202.12.124.151]) (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 ; Fri, 7 Mar 2025 23:18:40 +0000 (UTC) Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.stl.internal (Postfix) with ESMTP id D18551140162 for ; Fri, 7 Mar 2025 18:21:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Fri, 07 Mar 2025 18:21:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding: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=fm1; t=1741389675; x=1741476075; bh=QyMMK87OI2xOMK2ZiWSFQZS/2LohE7GETntLzD5cHFY=; b= Q22MOogWkuV2WBi0ukgOWLGy3kA4rTNRyF8vKvXt0uSBqs+nfpAcJZwbY1kmhPld lDNnZJljyBvZWkwsIv/OjtYMnpBFluZVvXyTg0p982rWak+dVYIoEc7sOSaKnrQz WYOQk+BGehklSVMcW6lDeT2O7Tf1XYvUygG0njtmNiI9Yy7bCeCdNzEJlIUIslP4 Q/RD/km/J1fbidylASYb2b2UpG/GK0aHpHl0fG+yuunPvFbn7viyP+qvZUX8xc2A mXPbBicNk/oNN4slprRt32qe9rbh1TG+llLk3/LCFMZhLgY9f4vh9KxP1jR/KIbE wvKMvrlkPWXmCEgMLa1WRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=fm1; t=1741389675; x=1741476075; bh=Q yMMK87OI2xOMK2ZiWSFQZS/2LohE7GETntLzD5cHFY=; b=X5CW/scwjM0kXgKbf e5IzBuzA9Oc6+U0zhGGh1SLviPKPJkGFKrL/UCqrFAj6ScptCavY2pFrjRtMBjqt 5umOkLsQaKilO55k2zIrR5MHzzbOTEpJAucbXZX4i5wqGBgcv/gzskU1xcvxom5S Taj542al2lAPZoP+QhEQqHUvy/YWtvcbxO1+HcCWwVOjsQfmXwm+32DJ0+ydZZ8u Je9L3VN+3A0xQD2naznl88LDHkQMjMTW53D428r0xkFcF66h/KpNrU79yaASk4uC eSnUSFwLbqkXntVTmT+T8DKjT24KyzUBVMXM64QcXLaMwTF8JaweTkbko4b1WZbX L2ZOg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduudduleeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpedftfhofigrnhcuvfhomhhm ihhnshculgfkoffuohfrngdfuceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqe enucggtffrrghtthgvrhhnpeffkeevudffuddvheejvdefkeelfedtudegfeehjeduheeg ieduffeggeegveefheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehimhhsohhprdhphhhpsehrfigvtgdrtghordhukhdpnhgspghrtghpthht ohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslh hishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 7 Mar 2025 18:21:14 -0500 (EST) Message-ID: Date: Fri, 7 Mar 2025 23:21:12 +0000 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] PHP True Async RFC To: internals@lists.php.net References: <9964db8c-0ffe-43d5-8246-47fc76b07180@app.fastmail.com> <78a03dd0-fd4a-4f4a-ad8a-37e5704f06fc@app.fastmail.com> <08c8ad0b-e8f4-46e3-99f0-b80748d40b89@app.fastmail.com> <07973EAE-2D83-47A8-8FA0-84286C77C02B@rwec.co.uk> <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> Content-Language: en-GB In-Reply-To: <48d66433-3ae9-4895-8361-7c81a0a3670d@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 07/03/2025 22:01, Larry Garfield wrote: > Is that what you're suggesting? If so, I'd have to think it through a bit more to see what guarantees that does[n't] provide. It might work. (I deliberately used spawn instead of "await" to avoid the mental association with JS async/await.) My biggest issue is that this is starting to feel like colored functions, even if partially transparent. Yes, that's pretty much what was in my head. I freely admit I haven't thought through the implications either. > My biggest issue is that this is starting to feel like colored functions, even if partially transparent. I think it's significantly *less* like coloured functions than passing around a nursery object. You could almost take this: async function foo($bar int, $baz string) {     spawn something_else(); } spawn foo(42, 'hello'); As sugar for this: function foo($bar int, $baz string, AsyncNursery $__nursery) {     $__nursery->spawn( something_else(...) ); } $__nursery->spawn( fn($n) => foo(42, 'hello', $n) ); However you spell it, you've had to change the function's *signature* in order to use async facilities in its *body*. If the body can say "get current nursery", it can be called even if its *immediate* caller has no knowledge of async code, as long as we have some reasonable definition of "current". -- Rowan Tommins [IMSoP]