Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127502 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 901241A00BC for ; Thu, 29 May 2025 07:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1748504966; bh=ajLUCwhHfVcfZgVzBvNQWMZFuDlQoia7wC8tXUpTy54=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZLjMWLTTYXZ0JfRwDHF7ZXvQ07e118qH0VU4Oqr9alAFOAI9syX7aF8AwSOQwyxgb vdlADEKzggY/6ksxy17v6lcijs8/cX2Vr+CtilOFUhmbeCZvQvq+TrGXgXwC/8O3lY k1ycGRDB+zJoXuEjR3AhZTPZmuRE4SwMuFLSd0tDi0jtP1RuZtOap3QnVcOkfsVuwy 0FyHJ95qPCfYlrkj+lnw6nfNZPOk1EYb9u4AwZUV5e5cKcYCNM6avfTk14KWToQ8st 8+l9AGKNN+HfMa+eq/JpcJOuwN5MbQNykZKSK6YuvIM0+7OI+ea/bKb6i09tjo7qyl gWjmwwh06ZPwA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4D59418004D for ; Thu, 29 May 2025 07:49:25 +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.4 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: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (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, 29 May 2025 07:49:25 +0000 (UTC) Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-70f86c9e3e7so6543647b3.1 for ; Thu, 29 May 2025 00:51:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1748505090; x=1749109890; 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=ajLUCwhHfVcfZgVzBvNQWMZFuDlQoia7wC8tXUpTy54=; b=UnuFL1bsOQ808vWivm9l2gJyioyJVME8ItClZM+t7xmY1XhtB9lAzOyiHXhkt/xNlU bJKkWJUxJLZKw48+TaiD7hEjbiZOcNEdpro15TOXAOn3pZXOSdz60pBxiPjJX+7DG+rw nzdZ3x7WxD5kK02n3a4zU/sAbUcSimyFAI28JPh8v0cFnf28ui6Xi0TZFRlcmSLE2RIg JhHi2/BTcR0Z+C1wKXGfOARRjzWBy5XEgemkkNb/QLHxamMkStUIRNZIibgZqVYvnlfU 2biTNNXcwXNxlh+vSq7qltivh+EO0tDviT0GlnU9LUxhldNB2OxUswxz2Gi9TSfuuMrs D1VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748505090; x=1749109890; 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=ajLUCwhHfVcfZgVzBvNQWMZFuDlQoia7wC8tXUpTy54=; b=L4y8NvC/gRGugsvk4SIHHIBAvwUbXi2kXzAtPGieJ2QJa0Jxz69THUMf5H0sqlgUhp 3UqEHpWbS83StO6VbkTVNTBhINkz5M+aC86/OHHhjPM6Ud6fLd07fvOYI5Ka3cKEoD++ 29o2VqeY1jen77HiREVlB1xIfGGi+h5NScT9GK+p2MJhyjjOVzYUeGNIzAwbnhUMmYoZ 1qvEmw7DgPBhWjw+95Yec70AMmVOYZQp9S+ZXe28pAOl5vD7iC9JwQjnHVHFEVK9k17X Jj8SUQZg1VyhtLYPesYCHUH+NY0vOmxrvG+g2b8QLHk1k+p68qL//Id/JEGB5e0KSvmI QRxA== X-Gm-Message-State: AOJu0YwyymosvFSC3nJskOm+wJyujhI6uKBNJqRs/olD4yJrq2CrbcCg K7Vn8txmRLZ7IzFrlwFYZs1l/8S7Bs3uGetYLjgRHA3WHs+VRQv8QMjjqaU0FBpnXmm48xSloxZ vg98111Iw4QDZxiVMJndKM42dW40gxA7/cWRzj00= X-Gm-Gg: ASbGncuYFdwBnMCXdm0x514CJZtb3a2PCCOY9VxuK84SdRHJGaW/+lBpGaaUmuH+GtS LrzHnMXlB4LO/mQX6GcIkEHTIkBzb3GPFdONzTSiwH/PnJR+4sKQrYFpUUzTfygVpfL2p6KYhxn 9t28akDrACmbYzCT0VqY5FyvVqR8itr+32 X-Google-Smtp-Source: AGHT+IFBvPU0JhVdeVePsfx/ogYPu7NH40eZrTL36X1P9HHh0tv6VBDWXs5F2J2hGCuLX87gxLhEQJPgIP5Ng1vx5NU= X-Received: by 2002:a05:690c:9202:b0:70c:c013:f2f with SMTP id 00721157ae682-70f8b924256mr15537657b3.35.1748505090604; Thu, 29 May 2025 00:51:30 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <5Q_DNeA5NK_aXkyoWmQZKVdlml8KLTwm9jeP7Y2vqQwZ8hxhfIIQdwF4-2Ra48E4Sob1aMXL2Hp-boAIZbQrSsfgNCNmm4LDduryOnC7K0Y=@proton.me> In-Reply-To: <5Q_DNeA5NK_aXkyoWmQZKVdlml8KLTwm9jeP7Y2vqQwZ8hxhfIIQdwF4-2Ra48E4Sob1aMXL2Hp-boAIZbQrSsfgNCNmm4LDduryOnC7K0Y=@proton.me> Date: Thu, 29 May 2025 10:51:19 +0300 X-Gm-Features: AX0GCFs6tNrqeYNb0kilP7pQcQH4D9IWKcdRxEdrYOrgDv5j6PkyNlhZpylvGNc Message-ID: Subject: Re: [PHP-DEV] Re: PHP True Async RFC Stage 3 To: carlos_silvaaaaa Cc: "internals@lists.php.net" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) Hello, Carlos! Thank you for your support. I feel like I should add a bit of jam to this story and share some news. When I set the two-week limit for the vote, Roman Pronskiy reached out to me almost immediately and offered direct contact with PHP CORE. I received maximum support and valuable advice from him. It gave me the opportunity to ask difficult questions about the PHP core. We now have a cozy little chat with PHP CORE members, for which I'm very grateful. Jakub created a separate project on GitHub: https://github.com/true-async/php-async where you can follow the development process live. Together with the PHP Team, a development plan for the **True Async** project was agreed upon. In broad terms, it goes as follows: * The current RFC will be simplified as much as possible to make it easier to pass. New syntax should be discussed closer to future versions of PHP (likely 9.0). If needed, I can explain why this is the case, but it=E2=80=99s truly an objective decision =E2=80=94 not just becau= se it=E2=80=99s hard to vote on, but also because `PHP` has consistency issues with its syntax. * We aim for an implementation where asynchrony and the PHP core are as decoupled from each other as possible. * Larry Garfield proposed the idea of long-term development planning. I hope it gains traction. As you can see, we haven=E2=80=99t been sitting idle :) Now, regarding the technical details. I like the idea of separating the **True Async** implementation from the core as much as possible, leaving only a thin API in the core. This is a complex architectural task with many nuances=E2=80=A6 and these nuances are hard to predict. That=E2=80=99s why, before moving the RFC forward, we need to see this API with our own eyes and test it hands-on. In the repository https://github.com/true-async/php-src/tree/true-async-api you can see what it looks like. And here: https://github.com/true-async/php-src/blob/true-async-api/Zend/ze= nd_async_API.h Almost everything has been extracted from the core (except for the Cancellation exception). That includes even the coroutine implementation. Once this API becomes available, PHP will no longer have limitations for other similar implementations. That=E2=80=99s why I=E2=80=99ve now proposed including this **API** in **PH= P 8.5**. If that happens, developers will be able to use asynchronous `PHP` in experimental mode. The experimental mode is extremely important for the project. A large and complex feature like asynchrony can=E2=80=99t be made perfect o= n the first try. The best measure of truth is real-world usage in real code and real scenarios. That=E2=80=99s why early access to the project, before making it standard, = is so crucial. My development experience (which includes plenty of funny stories) tells me this is the most reliable path to success. That=E2=80=99s why I decided to do a full refactoring before drafting the R= FC again. And the initial part of the refactoring is already complete. I can already say: IT WAS WORTH IT. * The hacks around starting the Scheduler have been removed. * A modern Scheduler mechanism has been implemented, which cuts the number of context switches in half =E2=80=94 and that=E2=80=99s significant= , considering that a single request might involve 10=E2=80=9320 switches. Next steps: * A separate branch will include changes to PHP related to STREAMS, DNS functions, and so on. * That=E2=80=99s also where you can expect the RFC to be updated. I hope my spoonful of jam was just in time :) Once again, thank you =E2=80=94 and thanks to everyone who supports this pr= oject! -- Ed