Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126668 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 899661A00BC for ; Sun, 9 Mar 2025 08:42:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1741509607; bh=FunbpVHhz2Bp2mIVaKCnrgEOdqxnUbsEQR8I5ecita8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MjQDbbBiGnXv5IvW3+dr3KRpQaDgvUdF/ZN/dulEwAexylbWZzSiT4v4NRztj9wef Sx/aKFQJn0W8c4M6NE7yNATuMux+vcpczl60G2lk7PdNGsQ61Xs7z9z61iOaA+9Nbd /cZSJTeM+ZES19LpxRu3x2G8IrUGspF5Z4Ln0IKBXWjosk8trBFSnoswKXj3G6RKO1 0yNHtDvIoUFxzUmKGbtJfJPC5YW6YEPaw5fV3508GvLCdZOqZBbasGJ21EIT8odVsE oatMmNVrmkjHkhMUpn+ui8JYneZtpnaqzN6KQ4pA1+64veopxMbo84CkIC7VJpWNCa XRdGBlqUsUvww== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C9802180034 for ; Sun, 9 Mar 2025 08:40:06 +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-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (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 ; Sun, 9 Mar 2025 08:40:06 +0000 (UTC) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-6fedefb1c9cso3028117b3.0 for ; Sun, 09 Mar 2025 00:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741509760; x=1742114560; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WhpMNIgMK5CpBe0pVIfvuoyjgaRo9Yuku5fcoNqdw6I=; b=RsTBBthPAka08iHrIXMnghIRjF2rRooU3f469VHUCt1cznOv1TdO2+7Fp8jq46+SfY +cIyj1i+vEPGrIY1bIVPV+J8IH/r2gSxCVcFnhOWLqrqpltPE4tOyVD5eANbv5WF2oGe QR+5yT8dquf6YFNft1YTvL7lUUk2tWrb/QlThfnNsgPzZPBUtpnuogCyksRJr+WqCDWr 6JHXcb/OvfZ7n+LamI1sxl3mH/+lPWjIOAmwe6BWJs0hPl0twsJCuMC3qRuQc06TShoL 0LgJqktt6TaTo+XnxMqihVIJJcIwK2nSr7ffCqle2dBII6Ao8v0I9p1M3qK7tyTJwcfO FvDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741509760; x=1742114560; h=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=WhpMNIgMK5CpBe0pVIfvuoyjgaRo9Yuku5fcoNqdw6I=; b=q9EKEvmQXvM33wpPwyH98UUSRpCpFvY+h3WY/ph667KzSgheAN4O7RjiU2rz8Kx9WU 9cRoEQGokBCZ7NIpc7z3VARPmADM99PkiXCYy5NvduboFuM5IryTrV7KUfITG9CyptzY LKqMQon2yRhxD3MVsQGZNdwZcva9XH+pnvbtJulT95tP2HKQq6ERNXxbcbQ8wdAtlaFG BE7g57B7d83PdLZUwFGxXtbA8HIuHzxevxMLLTIenh9EJxt2CyfwVGeieyHo1o2OnvGD mhO0snAYV7NZEQCZvU9FeV6mQTPSVgmfUBuf7PsU5IlF6BErFd4krAT7RxjGzvCu6KDe /Ejg== X-Gm-Message-State: AOJu0Yxd6TVmBLCFQ+F1YiQDmtT18f4C8HS/ScSQRXedNIOdsmXz8T0m QatHNcfVg2SlOfsLikLpPWr1ZXy1Y3PvF+DjkTZVNZWOQwm8YMxrDbBPFc59jl1z9tqiyCInVRo 8bJFD5/O0qdwt1eZFtQK6m2cTRk8= X-Gm-Gg: ASbGncvz0LTNKPDmt1xt5TQA29ebvEGaR2EtchboNP43Qm8mJ0bg6MZjEd79ao9g/c+ YCpOPPf7FdfYuMrXl/68ymLis0InGsbnCCgVVyMjKBBPt3jbeQDd7Uf5TTWGgf73yaLaQ84W8kd k+0diNVG1Iu03gXljmvLQIwO1xYA== X-Google-Smtp-Source: AGHT+IF0G0KOIXWA1vaK3crNRz/QjNXfKPTd/PZAuid5fhPvq8HLTsF+9rZuFXN3ubnxAdtWlwBwvRN0boZeBg7yixs= X-Received: by 2002:a05:690c:708b:b0:6fb:9bbf:d53b with SMTP id 00721157ae682-6febf3e1a11mr129279897b3.36.1741509760724; Sun, 09 Mar 2025 00:42:40 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <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> <8599eb8b-d4a3-4cb8-899a-25b134e0d64d@gmail.com> <74c4c726-63aa-44e0-84c9-840e13a65a4f@gmail.com> <77DC5F50-531D-49E8-8BE2-504A19CB5FFD@rwec.co.uk> <676e36e4-0b84-4d8c-b3db-2998831cd79d@gmail.com> <510B8EF1-9D07-41A8-9EA0-7D99CF7BFC91@rwec.co.uk> <4690cff0-7a48-4fe0-8310-688be253f976@gmail.com> In-Reply-To: <4690cff0-7a48-4fe0-8310-688be253f976@gmail.com> Date: Sun, 9 Mar 2025 10:42:30 +0200 X-Gm-Features: AQ5f1JrasYa_bROJ-1YagkV2bYvvUx3p20R1gpV19TukxOBuTnmiJo-wLaa9pYE Message-ID: Subject: Re: [PHP-DEV] PHP True Async RFC To: Daniil Gentili Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="000000000000a93969062fe4d684" From: edmond.ht@gmail.com (Edmond Dantes) --000000000000a93969062fe4d684 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > The wait_all block is EXPLICITLY DESIGNED to meddle with the internals of async libraries, > How exactly does it interfere with the implementation of asynchronous libraries? Especially considering that these libraries operate at the User-land level? It=E2=80=99s a contract. No more. No less. > > Libraries can full well handle cleanup of fibers in __destruct by themselves, without a wait_all block forcing them to reduce concurrency whenever the caller pleases. > Fiber is a final class, so there can be no destructors here. Even if you create a "Coroutine" class and allow defining a destructor, the result will be overly verbose code. I and many other developers have tested this. And the creators of AMPHP did not take this approach. Go doesn=E2=80=99t ha= ve it either. This is not a coincidence. > > It is, imo, a MAJOR FOOTGUN, and should not be even considered for implementation. > Why exactly is this a FOOTGUN? - Does this block lead to new violations of language integrity? - Does this block increase the likelihood of errors? A FOOTGUN is something that significantly breaks the language and pushes developers toward writing bad code. This is a rather serious flaw. --000000000000a93969062fe4d684 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>
>=C2=A0The wait_all block is EXPLICITLY DESIGNED to meddle with the = internals of async libraries,
>

How exactly= does it interfere with the implementation of asynchronous libraries?=C2=A0=
Especially considering that these libraries operate at the User-= land level? It=E2=80=99s a contract. No more. No less.

>
>=C2=A0 Libraries can full well handle cleanup of fibers in __destruct by themselve= s, without a wait_all block forcing them to reduce concurrency whenever the= caller pleases.
>
Fiber is a final class, so there c= an be no destructors here. Even if you create a "Coroutine" class= and allow defining a destructor, the result will be overly verbose code. I= and many other developers have tested this.
And the creators of AMPHP did not take this approach. Go doesn=E2=80=99t ha= ve it either. This is not a coincidence.=C2=A0

>= ;
>=C2=A0 It is, imo, a MAJOR FOOTGUN, and should not be even considered for implemen= tation.
>=C2=A0 =C2=A0

Why exactly is thi= s a FOOTGUN?

  • Does this block lead to new violations of language integrity?
  • Does this block increase the likelihood of errors?

A FOOTGUN is something that significantly breaks the language and pushes= developers toward writing bad code. This is a rather serious flaw.

--000000000000a93969062fe4d684--